让我们定义四个不同的点类:
type PointType
x
y
end
mutable struct PointMut
x
y
end
immutable PointImmut
x
y
end
struct PointStruct
x
y
end
PointType
和PointMut
有什么区别?为什么有人会选择其中之一?
此外,PointImmut
和PointStruct
有什么区别?
我倾向于认为它们只是同义词,但我没有找到明确说明,所以我想知道是否隐藏了一些微妙的差异。