Namespaces

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

How do people prefer namespaces to behave? For example, imagine that you had
a namespace option in Euphoria like this:

   import <file> into <namespace>

that behaved like include does, but the imported code would have to be
accessed through the namespace prefix. So if you had a file like this:

   -- test.e
   global integer number

and you wrote:

   import test.e into foo
   import test.e into bar

Would you expect 'foo.number' and 'bar.number' to reference the *same*
variable, or different variables? My thinking is that it would be more along
the lines of how Euphoria currently behaves to have them refer to the same
variable. On the other hand, it's awfully convenient for each namespace to
have it's own local data, like classes.

Thanks!

-- David Cuny

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

Search



Quick Links

User menu

Not signed in.

Misc Menu