f#Mutable可变数据操作示例代码

代码语言:f#

所属分类:其他

代码描述:f#Mutable可变数据操作示例代码

代码标签: 操作 示例

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

open System

type studentData =
   { ID : int;
      mutable IsRegistered : bool;
      mutable RegisteredText : string; }

let getStudent id =
   { ID = id;
      IsRegistered = false;
      RegisteredText = null; }

let registerStudents (students : studentData list) =
   students |> List.iter(fun st ->
      st.IsRegistered <- true
      st.RegisteredText <- sprintf "Registered %s" (DateTime.Now.ToString("hh:mm:ss".........完整代码请登录后点击上方下载按钮下载查看

网友评论0