Modules: Allow Module Overloading?
Modules bring up many new issues. Here is a new one for REBOL experts to consider:
Should programs be allowed to overload a module? That is, is it valid to load a module twice?
Concepts to remember when thinking about this question:
- Modules are identified by name (a word)
- Modules create their own context (namespace)
- Modules have version numbers
- Modules can be explicity loaded
- Modules can add exported values to the global environment
So, what advantage is there in allowing overload: It lets you overload exported functions of a module. For example, if some of your program requires an older version of a module, but other parts require a newer version.
This can become a complex issue, and we really like to keep complexity out of REBOL. If we can specify a few simple rules, programmers of all skill levels will benefit.
13 Comments
|