Here's the weapon to shoot yourself in the foot:  

```
julia> immutable A
       a
       end

julia> aa = A(5)
A(5)

julia> mutate!(a::A, val) = (global A; A.mutable = true; a.a=val; A.mutable = 
false; nothing)
mutate! (generic function with 1 method)

julia> mutate!(aa, 7)

julia> aa
A(7)
```

But please don't shoot at other people's feet! ;-)

> - should I design my program differently?

Yes.  Both the compiler and people expect immutables to be immutable,
and thus both will do things which lead to bugs when you mutate them.
Why not just use normal, mutable types?

Reply via email to