Thursday, September 6, 2007

F# ???

F# -
Functional language ???
Why do we need to learn that language ???

So far I know... this language is meant to be more mathematical at heart, and thus creates more separation between the lower level machine details and the developer's code.

functional programming is supposed to be a "higher level" of programming than Java or C.

#light
(* Sample Windows Forms Program *)

(* We need to open the Windows Forms library *)
open System.Windows.Forms

(* Create a window and set a few properties *)
let form = new Form(Visible=true, TopMost=true, Text="Welcome to F#")

(* Create a label to show some text in the form *)
let label =
let temp = new Label()
let x = 3 + (4 * 5)
(* Set the value of the Text*)
temp.Text <- x
(* Remember to return a value! *)
temp

(* Add the label to the form *)
do form.Controls.Add(label)

(* Finally, run the form *)
do Application.Run(form)

No comments: