Hello,
As I was navigating the forum about constant redefinition, I noticed that, as per 1.12 release notes:
- Redefinition of constants is now well defined and follows world age semantics (#57253). Additional redefinitions (e.g. of types) are now allowed. See the new manual chapter on world age.
And indeed, at least in the interactive command line (REPL) of Julia 1.13, the following session “just works” (no warning):
julia> const a=1
1
julia> const a=2
2
Still, reading through the docstring of the const keyword, it states at the end:
In some cases [bold format is mine] changing the value of a const variable gives a warning instead of an error. However, this can produce unpredictable behavior or corrupt the state of your program, and so should be avoided. This feature is intended only for convenience during interactive use.
So my question is: which are these “some cases” where redefining a const gives a warning?
Or is this text an
historical trace
of the “pre Julia 1.12 era”?