Re: Packages

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

CChris wrote:
> > 
> > Because this is the most serious problem the namespace/global resolution
> > system
> > has.

 
Matt Lewis wrote:
> So far, you're the only one who thinks so.  Not that it isn't something 
> that may be ultimately desirable, but calling it "the most serious
> problem" seems like hyperbole to me.  If there's anyone else, please
> chime in, and help CChris explain why this is so serious.

I believe Chris has an exagerated sense of this issue too. It is not a problem
in the sense that people are tripping up on it all the time and are thus being
frustrated by the language design.

This strikes me as a concept that Chris would like to see implemented because
its a neat one. And I agree with that. The concept of "packages" for Euphoria is
a nice one, but the lack of it is not, as we speak, causing any general angst.

I think that if I were to advocate such a concept, I'd do only two things:
(1) Create a new keyword that defines the scope of an identifier as being
limited to the package. This would work like 'global' but things outside the
package could not access the identifier.
  eg.
 sequence mVersion = "1.0"   -- seen only in containing file
 package integer vNextID     -- seen only in containing package
 global constant Foo = "FOO" -- seen only in containing application

(2) Define the term package as meaning "all the files in the same directory".

Thus statements in C:\foo\abc.e can access 'package' items in c:\foo\def.e but
statements in C:\bar\qwerty.e cannot see those 'package' items.

-- 
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