Re: Namespace Proposal
- Posted by Igor Kachan <kinz at peterlink.ru> Jun 23, 2001
- 423 views
Hello Irv, > On Saturday 23 June 2001 05:28, Igor Kachan wrote: > > <snip good idea> > > > I don't like the *superglobal* variant of automated > > main-fail priority. > > > > Global is global. No ? > > Not really - consider this: > > ------ file.a -------- > global atom pi > pi = 3.14159 > ------------------- > > ------- main -------- > include file.a > > object pi -- won't work. > > function f() > sequence pi -- works. > pi = "Apple" > return pi > end function > --------------------- > > Global or not, the mathmatic pi is overriden by the apple pi > in function f. > So the apple pi is local to the function, and takes priority > over the global while we are working within that namespace. > Why should we not be able to have a pi declared in the > main program which is local to "main", and also takes > priority over the global? Consistency is usually good. > > For clarity, perhaps it might also be good to require > a specific declaration to prove that we knew what we > were doing when we declared "pi" in the main file. > If our variable is declared as: > > "local atom pi" -- no conflict, takes precedence over > global, no warning issued. > > "atom pi" -- still takes precedence for consistency's > sake, but a warning is issued if there's a global of the > same name. > > If no global exists with the same name, then no warning, > no problem, and this syntax wouldn't break existing code. OK, Irv, but there is no keywords "local", "as", "name", "space" and so on in Eu now. And for the better understandig we must see onto the other symbols, i.e. declarations of procedures, functions and so on. We can not declare this sort of symbols in procedures and functions, same as constants and types and somewhat else. Try your example for the *constant pi=3.14* or for the "procedure pi()" and you will not have this (global ! = global) almost every time now. How can I explain to the readers of my Russian translation of the future Eu docs these inconsistencies, if global may not be global in the main file, which contains almost nothing new, but includes win32lib with 10000 global symbols, or all RDS includes with global procedures and functions, or Bernie Ryan's eu_engin ? Really global is global in Eu now and this simple conception is very well documented by RDS and the contributors. No ? Regards, Igor Kachan kinz at peterlink.ru