在 F# 中,我可以这样做:
type coord = float * float //Type for a 2D-float-tupple
let myDepthCurve1 = { coords = [(1., 2.); (3., 4.)]; depth = 9.4 }
但我不能这样做:
type coord = { longitude : float; latitude : float } //Type for a 2D-float-record
let myDepthCurve1 = { coords = [(longitude = 1., latitude = 2.); (longitude = 3., latitude = 4.)]; depth = 9.4 }
当坐标类型记录中的字段被标记时,我不能一次创建我的深度曲线,这是真的吗?