Clarify the documentation about modifying module variables

“calls eval” is just an off-hand mention, it doesn’t serve as an example like A.eval(:(data = 4)), as goerz said earlier, or @eval A data = 4. You’d have to look up eval to figure out these, so it’s normal not to immediately understand when you’re unfamiliar. Some passages are just dense with background information that reading comprehension slows to a crawl for anyone.

Yep, you can test these yourself in the REPL.

julia> module A data=1 end
Main.A

julia> A.data=2
2

julia> A.data
2

The writing that says you can’t do this and must instead use eval, has been outdated since v1.9.

1 Like