F#
范例
一些小小范例如下:
(* This is a comment *)(* Sample hello world program *)printf"Hello World!"
#lightopenMicrosoft.FSharp.Collection.List(* print a list of numbers recursively *)letrecprintlistl=(* When using "#light", you must indent with 4 spaces *)ifl=[]thenelseprintf"%d\n"(nthl0)printlist(tll)
#light(* Sample Windows Forms Program *)(* We need to open the Windows Forms library *)openSystem.Windows.Forms(* Create a window and set a few properties *)letform=newForm(Visible=true,TopMost=true,Text="Welcome to F#")(* Create a label to show some text in the form *)letlabel=lettemp=newLabel()letx=3+(4*5)(* Set the value of the Text*)temp.Textx(* Remember to return a value! *)temp(* Add the label to the form *)doform.Controls.Add(label)(* Finally, run the form *)doApplication.Run(form)
F#兼容于XNA Game Studio Express产品,可允许在Xbox 360上建构游戏软体。
免责声明:以上内容版权归原作者所有,如有侵犯您的原创版权请告知,我们将尽快删除相关内容。感谢每一位辛勤著写的作者,感谢每一位的分享。
- 有价值
- 一般般
- 没价值