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產(chǎn)品,可允許在Xbox 360上建構(gòu)游戲軟體。
免責聲明:以上內(nèi)容版權(quán)歸原作者所有,如有侵犯您的原創(chuàng)版權(quán)請告知,我們將盡快刪除相關內(nèi)容。感謝每一位辛勤著寫的作者,感謝每一位的分享。
- 有價值
- 一般般
- 沒價值
{{item.userName}} 舉報
{{item.time}} {{item.replyListShow ? '收起' : '展開'}}評論 {{curReplyId == item.id ? '取消回復' : '回復'}}
{{_reply.userName}} 舉報
{{_reply.time}}