Re: My not-quite obsolete namespace parser

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

On  0, irv at take.maxleft.com wrote:
> Despite what Rob said earlier, Euphoria's namespacing 
> doesn't work as well as C, Pascal, etc. It doesn't work 
> as a normal programmer (if there is such a thing) would 
> expect.
> 
> A simple example in C:
> 
> /* Contents of main.c */
> #include "./misc.c"
> #include "./gtk/misc.c"
> 
> int main()
> {
>  foo();
>  bar();
>  return 0;
> }
> 
> /* Contents of misc.c */
> void foo()
> {
>  printf("Foo\n");
> }
> 
> /* Contents of /gtk/misc.c */
> void bar()
> {
>  printf("Bar\n");
> }
> 
> Save these three files, compile and execute.
> [irv at localhost irv]$ ./main
> Foo
> Bar
> 
> Just what you'd expect, right?
> 
> Do the same thing in Euphoria, and you'll get an
> error:
> [irv@localhost irv]$ exu main
> Foo
> main.exu:5
> bar has not been declared
> bar()
>   ^
> 
> Why hasn't bar() been declared?
> 
> Because to Euphoria, ./misc.e and ./gtk/misc.e are 
> duplicates, even though the include name and file 
> content are different. Our only option is to re-name 
> one or the other. You can surely think of reasons why 
> this would be undesirable, especially if we want 
> to distribute programs using other peoples' includes.
> 
> I can see absolutely no reason that Euphoria should 
> function in this manner.
> 
> Regards,
> Irv
> 

Ugh! So that is a "feature". Well, I'll work on modifying my namespace
parser to fix it. Should only take a few minor modifications.

jbrown



-- 
http://fastmail.fm
Any faster and it wouldn't be e-mail!

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

Search



Quick Links

User menu

Not signed in.

Misc Menu