Re: Namespace idea

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

Hawke wrote:

<snip>
> after reading your post, i pondered it for a while, and grew to like it...
> as well as some other namespace suggesstions prior to this post, irv,
etal.
>
> i have one serious fear with your post however...
> i feel as though all those namespace lookup for each call of a function
> will *DRASTICALLY* alter the speed of recursion, which is one of EU's
> main strong points...
> i will however assume that rob can apply some cacheing for the function
> lookups for recursion to alleviate any overhead your suggesstion might
have
> :)
> --Hawke

Hawke,

In the compiler, all ambiguity resolution would be done at compile time--run
time cost zero.  In the interpreter, ambiguity resolution would be done once
the first time the symbol is encountered, the interpreter would replace it
with the appropriate fully-qualified symbol--cost fairly small.  The
programmer could also be given the option of specifing an absolute symbol
name: all symbols would be included in the global namespace (named
"global"), some of them would be nested in another namespace.  Thus

global.foo.yuck

would mean "use yuck from the foo namespace in the global namespace; if it
doesn't exist there, give an error, don't search elsewhere while

foo.yuck

would use the search algorithm.  So the small cost could be reduced to zero
in critcal cases.

-- Mike Nelson


would search as alredy suggested.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu