Proposal: Private modules (general discussion)

That’s a good question @asummers. Unfortunately __MyPrivateModule__ is not a valid alias name. Anything that starts with an underscore is either a function name or a variable. We could change the language to make __MyPrivateModule__ actually be an alias by checking the first letter after the underscores but that would not work with existing variables such as __MODULE__ and __ENV__. We would need to at least special case them in the parser (which is fine, they are already special cased in the compiler anyway).

The only downside of this approach is that it doesn’t say to which modules an underscored module would be visible to.

1 Like