📜  f# 中的 ref - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:42.645000             🧑  作者: Mango

代码示例1
let a = ref 5  // allocates a new record on the heap
let b = a      // b references the same record
b := 10        // modifies the value of 'a' as well!

let mutable a = 5 // mutable value on the stack
let mutable b = a // new mutable value initialized to current value of 'a'
b <- 10           // modifies the value of 'b' only!