这不是有效的语法,但是是否可以执行类似的操作来获取新的更新的匿名记录,类似于使用
with
处理普通记录?
type user = User {id: int, ... more fields}
let u = User {id = 1, ...}
let u2 = User with id = 2
20:01 < discocaml> <deepspacejohn> you can bind the record to a name with `let Thing t2 = t`
20:01 < discocaml> <deepspacejohn> `let t = Thing {id = 1} in let Thing t2 = t in Thing {t2 with id = 2}`