Re: Namespaces
- Posted by Everett Williams <rett at GVTC.COM> Sep 27, 1999
- 574 views
On Mon, 27 Sep 1999 15:28:28 +0300, Glen T. Brown <gbrown at SAUDIONLINE.COM.SA> wrote: >When Irv brings this very intriguing concept to the >surface anout include files not getting along with each other. There is >something that we all can do to help, instead of relying on 'Rob' to solve >all the little problems. Of course this "fix" would be the responsibility >of every one of us that cares. > First, this isn't a little problem. It is central to the future of the language. >You said that it would be nice if, in order to access a routine from an >include file that you had to use that files name as a prefix to the routine. My preference is to allow "named" includes to keep the prefixes short. These might be something of the order of include foo=foo_this_name_is_to_long_to_easily_use.e very much like a globally declared constant, which in reality, it is. Now everything gets prefixed with foo. To prevent the build up of includes recursively calling includes, the interpreter can strip off the prefix and compare file names to prevent multiple copies of an include being loaded. This would require aliasing when the same variables and routines were called with different prefixes, but scoping will take care of most of the real problems in this area. Some of Ralf's ideas on scoping of variables in includes could also be used here. I'm running out of gas on this one :) but leaving it entirely to the programmers to stay out each others' way is likely to cause a great deal of trouble in the future. Everett L.(Rett) Williams rett at gvtc.com