RE: namespace coflicts: local vs private symbols

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

I don't think this proposal is wise enough. First, I know of no other
language supporting
it (maybe some of you do). Second, I think a routine should not be dependent
on things external to
it. Third, it seems difficult to implement, because after sequence x is
declared, to know if x has a previous value will entail going backwards in
the symbol chain, also with negative effects in performance. Fourth, if you
add an option to specify "local" or "external" variables, then the routine
will depend on the environment in which it is executed, and consequently
will be difficult to transport to other programs.
Regards.
----- Original Message -----
From: Lewis Townsend <Keroltarr at hotmail.com>
Subject: namespace conflicts: local vs private symbols


>
> Hello Robert, all,
>
> I may be addressing an old issue here but just a thought for future
releases
> of Eu:  With the (relatively) new namespacing abilities of Euphoria you
can
> differentiate (sp?) between conflicting global identifiers by using
> prefixes. I wish there were a similar way to identify local symbols in
> routine that has a private symbol of the same name. Here is an example
> program that doesn't work without renaming something.
>
> sequence x
> x = {0,0,0,0}
> procedure p ()
> sequence x
> x = x + 1
> ? x
> end procedure
> ? x
> p ()
> ? x
>
> I would like to see:
> {0,0,0,0}
> {1,1,1,1}
> {0,0,0,0}
>
> I get this error:
> variable x has not been assigned a value
>
> I would prefer it check the local symbol for a value before returning an
> error. An alternate handling of this situation could require a prefix such
> as "local:" or something like that.
>
> Just some thoughts here folks, any comments?
>
>
>
> TOPICA - Start your own email discussion group. FREE!
>

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

Search



Quick Links

User menu

Not signed in.

Misc Menu