Why don't we have EACH?

BlitzMax Forums/BlitzMax Programming/Why don't we have EACH?

Correct, Imports can't access your main programs globals or anything that is in the import tree "above" them. They only know of the world they temself import and have.

On the why you would do that: This way, you can encapsulate code that does not need to have a reference to an outside point. For example your sprite system would be such a thing, where it makes sense to encapsulate it.

Include is most likely to seperate logical units and mostly needed in situations where BM fails due to its incomplete C like implementation (because you can't define types and implement them elsewhere, you often get in the situation where you create "import circles" that are not allowed. In that situation you include all the needed files into a new bmx and import that for example)

I normally wouldn't use Include anymore. It just makes it far harder to track all globals, types etc you have in the file as the file parts are split all over different files.


Modules, as you mention them, are again another thing. They exist on a "higher" level and can be used as framework for example. They can have included documentation information as well, that will lead to html documenation file on build modules.