Re: A Problem with v2.4 (for Rob)

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

Hello Derek, you wrote:

> From: "Juergen Luethje" <j.lue at gmx.de>
>> Hello Derek, you wrote:
>
> [snip]
>
>>>
>>> That is not quite what is happening. Euphoria sees "DoSomething()" so it
>>> looks for a local routine with this name. If it can't find one, it looks
>>> for a global routine with this name. In this case it finds two global
>>> routines with this name.
>>
>> Maybe I'm wrong, but in my understanding the two global routines have
>> *different* names: One name is 'DoSomething()', and the other name is
>> 'MF:DoSomething()'.
>
> Well if that was the case then Euphoria would not complain about having to
> need a namespace to remove an ambiguous reference, because there would be no
> ambiguous reference if they had different names.

I meant: From a logical point of view, I regard 'DoSomething()' and
'MF:DoSomething()' as two different names. I know, that Euphoria can't
realize that at the moment, but I don't see any logical reason, why.

>>> Now, which one did you actually mean to use? How
>>> would Euphoria know? For example, if it assumes that because you didn't use
>>> the namespace qualifier that it should use the routine in a file that
>>> wasn't namespaced?
>>
>> Yes. Isn't this situation similar to that one, when you start a program
>> say 'myprog.exe' from the command line? If the program is in the current
>> directory or in a directory on the PATH, and you want to run this one,
>> you just have to type 'myprog.exe'. If you want to run another program
>> with this name in another directory that is not on the PATH, you can do
>> this by typing the full qualified name, e.g. 'C:\test\myprog.exe'.
>
> MS-DOS has built in rules about how to search for for program files. The
> most important, in this context, is that it STOPS searching when it finds
> one that matches the one you typed in. It does not find ALL possible
> matching files then tries to decide which to run. Euphoria does look for all
> matching ids.

Yes, of course. The idea only works, if there is not more that one of
those "critical" include files without a namespace identifier.
E.g. given 3 include files with identical code, using
   include file1.e
   include file2.e
   include file3.e as i3

cannot work.
But using
   include file1.e
   include file2.e as i2
   include file3.e as i3

should work, because any file has an unambiguous namespace. file1.e has
the namespace "" which is not nothing. Eu IMHO should be able to handle
that.

>>> Maybe, but that assumes you INTENDED to leave off the
>>> namespace qualifier.
>>
>> Yes.
>
> But how would Eu know that. You could have just forgotten to put it on.

Eu can't know that, unless Rob gives us a "do what I mean, not what I
say" (DWIM) interpreter. blink
There are many other situations, were Eu must rely on the assumption,
that what I wrote, was what I intended to write.
In contrast to Eu, I know what I want, and at the moment, Eu forces me
*unnecessarily* to write things, that I don't want.
Al already wrote in more detail about that in the meantime.

Best regards,
   Juergen

-- 
 /"\  ASCII ribbon campain  |    |\      _,,,---,,_
 \ /  against HTML in       |    /,`.-'`'    -.  ;-;;,_
  X   e-mail and news,      |   |,4-  ) )-,_..;\ (  `'-'
 / \  and unneeded MIME     |  '---''(_/--'  `-'\_)

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

Search



Quick Links

User menu

Not signed in.

Misc Menu