I may have missed something but wouldn't
immutable t
x
y
end
immutable t
x
y
end
type u
x
y
end
work?
julia> myvar = t(1,2)
julia> myvar.x=5
ERROR: type t is immutable
julia> v = u(t(1,2), t(3,4))
u(t(1,2),t(3,4))
julia> v.x
t(1,2)
v.x=t(5,6)
t(5,6)
v.x.x=42
ERROR: type t is immutable
If you really want to guaranty constant fields, you have to type them to
some constant type.
