Re: Global = root of all evil
- Posted by Chris Bensler <bensler at nt.net> Nov 06, 2006
- 576 views
Eu needs 2 things ot deal with global contamination. 1. more robust namespacing capabilties. 2. more robust include namespacing. Both of these issues have been beaten to death. IMO the best solution for namespacing is to allow arbitrary, top-level code blocks to be namespaced. This still creates global contamination via the namespaces themselves though. The namespaces can have their own pool however which would reduce that greatly. If they have their own pool, then we also have a potential problem of contamination of the qualifier pool. We can further reduce global contamination by enhancing the include system. My preference would be to break existing behaviour and add the ability to declare includes as global. To access a global in an include file one would then have to include the file as global. If the file A were nested in another include file B, then file A would have to be globall included in file B and file B would have to be globally included in the current file. This is called chaining and would alleviate a huge majority of all global conflicts on it's own. The same thing could be achieved without breaking compatability by introducing a new keyword. But I don't think it's as elegant. An additional way to reduce contamination would be to allow locals (including local namespaces) to be accessed globally by qualifying them. Chris Bensler ~ The difference between ordinary and extraordinary is that little extra ~ http://empire.iwireweb.com - Empire for Euphoria