REBOL 3.0

Modules: Allow Module Overloading?

Carl Sassenrath, CTO
REBOL Technologies
12-Oct-2006 18:20 GMT

Article #0050
Main page || Index || Prior Article [0049] || Next Article [0051] || 13 Comments || Send feedback

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

REBOL 3.0
Updated 24-May-2017 - Edit - Copyright REBOL Technologies - REBOL.net