1. <strong id="7actg"></strong>
    2. <table id="7actg"></table>

    3. <address id="7actg"></address>
      <address id="7actg"></address>
      1. <object id="7actg"><tt id="7actg"></tt></object>

        F#函數(shù)式編程語言

        聯(lián)合創(chuàng)作 · 2023-09-30 17:33

        F#是由微軟發(fā)展的為微軟.NET語言提供運(yùn)行環(huán)境的程序設(shè)計(jì)語言,是函數(shù)編程語言(FP,F(xiàn)unctional Programming),函數(shù)編程語言最重要的基礎(chǔ)是Lambda Calculus。它是基于OCaml的,而OCaml是基于ML函 數(shù)程式語言。有時(shí)F# 和 OCaml 的程式是可以交互編譯的。

        F#已經(jīng)接近成熟,支援Higher-Order Function、Currying、Lazy Evaluation、Continuations、Pattern Matching、Closure、List Processing、Meta-Programming。這是一個(gè)用于顯示.NET在不同編程語言間互通的程序設(shè)計(jì),可以被.NET中的任意其它代碼編 譯和調(diào)用。

        F#將被集成在Visual Studio 2010中,含有對.Net Framework的完全支持。

        一些小小范例如下:

        (* This is a comment *)
        (* Sample hello world program *)
        printf "Hello World!"

         

        #light
        open Microsoft.FSharp.Collection.List
        (* print a list of numbers recursively *)
        let rec printlist l =
            (* When using "#light", you must indent with 4 spaces *)
            if l = [] then
            else
                printf "%d\n" (nth l 0)
                printlist (tl l)

         

        #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)
        瀏覽 23
        點(diǎn)贊
        評(píng)論
        收藏
        分享

        手機(jī)掃一掃分享

        編輯 分享
        舉報(bào)
        評(píng)論
        圖片
        表情
        推薦
        點(diǎn)贊
        評(píng)論
        收藏
        分享

        手機(jī)掃一掃分享

        編輯 分享
        舉報(bào)
        1. <strong id="7actg"></strong>
        2. <table id="7actg"></table>

        3. <address id="7actg"></address>
          <address id="7actg"></address>
          1. <object id="7actg"><tt id="7actg"></tt></object>
            女人高潮抽搐hd | 女开嫩苞精品第一 | 好硬好紧进去好爽视频 | 搞黄在线观看 | 国产 欧美 日韩 | freehd国产hd | 免费 成人 女姛视频 | www.人人色 | 鲤鱼乡全肉整夜不拔bl双珏记 | 国模超大尺度 |