Mauro <[email protected]> wrote: > On Tue, 2016-04-12 at 11:03, Didier Verna <[email protected]> wrote: >> What is the rationale behind module state being read-only from the outside? > > Encapsulation? Seems good to me.
Hmmm. Not convinced. There are different facets to encapsulation. Information hiding seems more important to me, and this is orthogonal to mutation. Read: I don't like people to see my private parts, even if they don't touch them :-D Can you hide information in a module? It seems that even unexported variables can be accessed through dot notation. In the same vein, I find the behavior of "global" (depending on reference vs. assignment) really weird (but there, I could understand some concerns for performance in the context of mutation). > Use a function Accessors, yeah. > You can also eval into a module: Interesting thanks. Is there such a thing as a mutable "current module"? I mean, can you interactively or programmatically switch to another module ? -- ELS'16 registration open! http://www.european-lisp-symposium.org Lisp, Jazz, Aïkido: http://www.didierverna.info
