<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          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ù)程式語言。有時F# 和 OCaml 的程式是可以交互編譯的。

          F#已經(jīng)接近成熟,支援Higher-Order Function、Currying、Lazy Evaluation、Continuations、Pattern Matching、Closure、List Processing、Meta-Programming。這是一個用于顯示.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)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  人人操人人天天夜夜 | 欧美狠狠操 | 孕妇孕交性一级A片 | 欧美老女人操持 | 婷婷国产精品久久久 |