Re: Data hiding

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

Igor Kachan wrote:
> 
> To resolve the examples like to above one, I'd suggest some
> new parameter for the "as" metacommand - "sublibrary":
> 
include lib_a.e as sublibrary -- all globals of lib_a.e

> I think, we can implement some useful things using new
> parameters for old good key words 'with', 'without' and 'as'.
> For now, I do not see any need of new keywords in Euphoria.
> 
> > I'd be interested in hearing from people other than us 3. :)
> 
> OK, did you listen to me, may I continue ?    smile

It's a good idea in that it doesn't create any new keywords.  My only
concern is that we're overloading the 'as' usage of include.  
Obviously, you couldn't have a namespace called sublibrary.  How would
you namespace something that was included as a sublibrary?

The with/without directives are easier to add functionality to since their
next parameter defines the functionality by definition.  Here, you've 
changed the as keyword.  It's easy enough to implement into the parser,
but I think it's not obvious that you're not just assigning a namespace.

Maybe something like:
include as private lib.e as lib


The difference being that the placement of 'as' changes its meaning, rather
than simply what comes after.  I think I like 'private' over sublibrary.
It's a bit more direct and connected with what its really doing.  But
this syntax seems to stand out more to me than changing 'include' to 
'import.'

Matt

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

Search



Quick Links

User menu

Not signed in.

Misc Menu