Re: Do you currently use namespaces?

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

Jeremy Cowgar wrote:
> 
> ken mortenson wrote:
> > 
> > Jeremy Cowgar wrote:
> >  
> > > -- filea.e
> > > global procedure hello()
> >  
> > > -- fileb.e
> > > include filea.e as a
> > > global procedure hello()
> >  
> > > -- myprog.ex
> > > include fileb.e as b
> > > b:hello() -- prints "fileb: hello"
> > > 
> > > myprog.ex cannot access a:hello() in any way. It would have to directly
> > > include
> > > filea.e to access filea.e's hello()
> > 
> > Amazing, you figured out what I was trying to say even when I couldn't!!!
> > 
> > Let me look at this...
> > 
> > You say myprog.ex can't access a:hello() in any way.  Got that.  But
> > again, a include c, b include d.  If I understand correctly, then
> > myprog.ex could call c:hello() or d:hello() even though they are not
> > declared in myprog?
> > 
> 
> No, that's incorrect. if myprog.ex never includes directly c, or d then myprog
> could not call c:hello() nor d:hello().

To clarify, the reason for this is that a:hello() is masked by b:hello().  If
there were no b:hello(), then b:hello() would really refer to the hello()
in filea.e.

Matt

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

Search



Quick Links

User menu

Not signed in.

Misc Menu