Modules: no global words
R3.0 has no global context. Each module provides its own "global context".
This change is important for these reasons:
- It makes modules truly independent namespaces. For example, changing the value of a system word does not affect the value of that word in other modules. E.g. if you want to set system to none, it's no longer going to crash REBOL.
- It allows special system words and plugin component words to be optimized without the word table limitation that occurs in 2.0. (The 2.0 limitation comes from C pointers directly referencing important system values, so that context can never be relocated in memory.)
- The system/words object no longer holds all words. Instead, it holds the words that your script module knows about, which does include many system functions/objects, but only those that have been exported to your script.
Note that when you run a script in REBOL, a runtime module is built to serve as the global context for that script.
Note that this change also allows REBOL to be more secure, but at the cost of full system access reflectivity. This changes the way you probe the system to see how it works or to make patches. (You can still do that, but your script requires the necessary security permissions.)
I mentioned this in an earlier article. This is just a reminder under the module thread.