const x = 4 x = 3
issues a warning but still changes the value of
x. And you can change bits-type fields of constant instances of mutable types without even getting a warning:
mutable struct Mut x::Int64 end const myMut = Mut(5) myMut.x = 6
What is the point of constant variables if they can be changed? Apparently declaring global variables to be constant can improve performance - but if they’re not actually constant, then are you getting that speedup for free?