Re: Namespace Qualifiers

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Tue, 11 Mar 2003 00:38:10 +0000, Pete Lomax <petelomax at blueyonder.co.uk> 
wrote:

>
> On Sun, 9 Mar 2003 10:51:03 +1100, Derek Parnell
> <ddparnell at bigpond.com> wrote:
>
>> You can't. Euphoria's namespace concept does not help us in this 
>> situation.
>>
>> I would reason that because win32lib does NOT include win_misc.ew, 
>> either
>> explicitly or implicitly, that the 'or_all' that win32lib is referring 
>> to is
>> the one in tk_maths.e, which win32lib DOES include. Why Euphoria thinks 
>> that
>> win32lib might be trying to refer to a version of a routine that it had 
>> no
>> knowledge of is weird.
>>
>> What I need to do is to put namespace qualifiers on every routine that
>> win32lib references. There must be only a few thousand of those....
>
> So what is the "proper" solution then?
>
> a) change std Eu to automagically resolve duplicate globals based on 
> include level; an included file referencing an included global it
> has itself included clearly means that one and no other.

This would be my preference.

> b) get smart; the or_all routine in tk_maths.e and the one in win_misc.ew 
> are nothing if not identical; they should resolve to the exact same 
> bytecode. Better than moaning about a conflict, the interpreter should 
> just take the first; the binder/translator
> optimise the second out of existence.

Assuming that the bytecodes are identical. That is not always the case.

in one file we have ...
  global True = 1

and in another file we have ...
  global True = ".T."

> c) extend namespace references somehow at the top level to state that
> I mean the "or_all" sub-included by file x rather than the one sub- 
> included by file y?

This is not really an isue because at the top level the normal namespace 
qualifier can suffice. The problem is when two independant files are 
included and each of them refer to a global in one of their included files. 
We should not have to change the source code for the files I have just 
included.

-- 

cheers,
Derek Parnell

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu