RE: Namespace improvement ?

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

Chris Bensler wrote:
> 
> The attraction of Euphoria is it's simplicity, and it's powerful use of 
> the few existing concepts that are available.
> 
> I think there is a good solution the the namespacing problem, but it 
> requires breaking backwards compatability. IMO for this change, it would 
> be worth breaking from the mould...
> 
> My suggestion is that the scope of an include file should only extend to 
> the caller.
.....

> To address the namespacing issue directly, I propose an 'alias' keyword.
> Alias would allow the programmer to specifiy exactly which identifier 
> they want to refer to and make a shortcut method of identifying it.

I couldn't agree more vigorously!!!

Simplicity is elegance, and Euphoria does a good job at it. Resolving
the namespace issue as Chris suggests, would make it conceptually
crystal clear. At the same time it would mean less work in the vast 
majority of projects.

IMO, if A includes B which includes C, then it is no business of A
to know anything about C (not even that there is such a thing as C).

If the programmer of B specifically wants something visible at "upper
level" (in this case A), then let him explicitly state that in B.

If somebody needs to use C directly, then let him, by importing C
directly into A. But nothing from C should get to A via B -- not 
automatically.

Aliases would be an easy, logical, and even error-resistant way to
"carry C names from B to A". (Badly said, short-circuit at my brain
cell #2938492839423.)

----

Of course this may crap up a lot of existing code. Since I don't have
code of my own that is affected by this, I feel QUALIFIED
to think about this "objectively".

I think this is a pretty important issue. 

-- Another Euphoric, since Nov. 18, 2004 --

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

Search



Quick Links

User menu

Not signed in.

Misc Menu