Saturday, October 30, 2010

Studying F# : Currying

In this article, there is a sample about the finction having more than one parameter:
val sum : int = 8

> printf "%d" sum;;
8val it : unit = ()

And now, we want to do Currying for this function. How should we do?

Thursday, October 28, 2010

Studying F# : Difference of List, Array and Tuple

Now I'm studying about F#. And I learned the difference of List, Array and Tuple.

List

A list in F# is an ordered, immutable series of elements of the same type.
Each elements are separated by semicolons.
> let integer_list = [1; 2; 3];;

val integer_list : int list = [1; 2; 3]

> let string_list = ["a"; "b"; "c"];;

val string_list : string list = ["a"; "b"; "c"]

Monday, October 25, 2010

IronRuby 1.1.1 is released

A few days ago, IronRuby 1.1.1 has been released. It is the first release compatible with Ruby 1.9.2. And now, non-English languages are recognized almost correctly.

Friday, October 22, 2010

If you want to use Mono 2.8 on openSUSE 11.3 immediately...

In default Mono repository for openSUSE 11.3 (http://download.opensuse.org/repositories/Mono/openSUSE_11.3/), there are packages of version 2.6, not 2.8. If you want to use Mono 2.8 on openSUSE 11.3 immediately, use the repository below:

http://ftp.novell.com/pub/mono/download-stable/openSUSE_11.3/

Tuesday, October 19, 2010

F# TIMTOWTDI : fibonacci

1st step

let defines function, and let rec defines recursive function.
> let rec fibonacci n = if n=0 then 0 elif n=1 then 1 else fibonacci(n-2) + fibonacci(n-1);;
> for i in [0..10] do
-     let fibn = fibonacci i
-     printfn "%d" fibn
- done;;
0
1
1
2
3
5
8
13
21
34
55
val it : unit = ()