Re: Name-space proposal

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

Bernie Ryan wrote:
> Matt:
> 
>    That is not what I mean:
> 
>    I write program with no name-space includes.
> 
>    I have a function called abs() in my program and I
> 
>    include some file that also has a function called abs()
> 
>    contained in it.
> 
>    The interpeter will abort giving an name-space error.
> 
>    I want the interpeter to just continue to run the program
> 
>    and report the error as warning when it exits.
>  
>    This way you don't have to keep starting/stopping to correct
> 
>    name-space errors or this would allow you to run a program
> 
>    using your own abs() function instead of another abs() in
> 
>    someone's include file.
> 
>    This would be like over-riding a function.      
>  
> Bernie
> 
> My files in archive:
> WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API 
> 
> Can be downloaded here:
> <a
> href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan</a>

I'm missing what you mean, Bernie.

Here, I tried the following code...
-- abs.e

global procedure abs()
    puts(1, "abs in abs.e\n")
end procedure

abs()

-- end file


-- ns-test2.ex

include abs.e

global procedure abs()
    puts(1, "abs in ns-test2.ex.\n")
end procedure

abs()

-- end file


and it worked without error.

I even went down one more level (created a file with abs that was included by
abs.e) and it still worked as expected.

In fact, the only way to get an error is to not override the function.

--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
"Premature optimization is the root of all evil in programming."
--C.A.R. Hoare
j.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu