Re: Do you currently use namespaces?

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

ken mortenson wrote:
> 
> Jeremy Cowgar wrote:
> >how does include make it not modular?
> >I do not see how what you said is making Euphoria not modular?
> >Can you expand a bit?


> ... Good modules should have certain features.  
> 
> Decoupling is an important principle as well as the principle of
> information hiding.  They don't expose their internal structure but 
> do expose an interface.
> 
> What happens when you include a file?  Everything becomes exposed!
> This, needless to say, does not promote information hiding!

Ummm ... actually this happens *not* to be the case... The ONLY things that are
exposed are the symbols explicitly marked as 'global' within the file being
included. For example ...

If I have a file, exam.e, that contains the following lines ...
procedure foo()
 end procedure
 
 global procedure bar()
 end procedure


And another file that includes this ...

include exem.e
  foo() -- Fails because it can't be seen 
  bar() -- Succeeds because 'exam.e' declared it global.



-- 
Derek Parnell
Melbourne, Australia
Skype name: derek.j.parnell

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

Search



Quick Links

User menu

Not signed in.

Misc Menu