Re: Why doesn't this work? (short)

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

Hello Al, you wrote:

> Why doesn't this work?
>
>
> Three simple files...
>
>
> --in file "Main.exw"
> include AStruct.ew as AS
> include BStruct.ew as BS
> atom addr
> addr=AS:allocate()--want to call AStruct's allocator.
>
>
> --in file "AStruct.ew"
> include machine.e as mach --namespace so i can reuse "allocate"
> atom addr
> global function allocate()
>   addr=mach:allocate(64)
>   return addr
> end function
>
>
> --in file "BStruct.ew"
> include machine.e

"machine.e" is included in "BStruct.ew", and "BStruct.ew" is included
in "Main.exw". So "machine.e" is indirectly included in "Main.exw".
It looks to me, as if the command 'include BStruct.ew as BS' only adds
the namespace qualifier to the global routines physically contained in
the file "BStruct.ew". Maybe.
If so, then IMHO it's the same problem, that is discussed in the thread
"A Problem with v2.4 (for Rob)".

> atom addr
> addr=allocate(64)
>
>
> --resulting error message:
> ---------------------------------------------------------
> C:\Euphoria\Projects\Tests\Ns2\BStruct.ew:5
> A namespace qualifier is needed to resolve allocate.
> allocate is defined as a global symbol in:
>     C:\EUPHORIA\include\machine.e
>     C:\Euphoria\Projects\Tests\Ns2\AStruct.ew
>
> addr=allocate(64)
>             ^
>
>
> Press Enter...
> ----------------------------------------------------------
>
> Any ideas?
>
> Take care,
> Al

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