R
rolo
Hi
Using modules to define namespace is good and efficient?
rolo
Using modules to define namespace is good and efficient?
rolo
rolo said:Using modules to define namespace is good and efficient?
Hi
Using modules to define namespace is good and efficient?
Phil Tomson said:Sure.
Commentary: It's interesting that we're getting all these questions about
namespaces and modules lately.
Using modules to define namespace is good and efficient?
Modules define:
1. namespaces, within which symbols are referenced
2. mix-ins, which add behavior to another module or class
These two distinct uses cause some "semantic shear," to paraphrase Neal
Stephenson.
Taking a different view, though, these two uses can be seen as the same
thing. Modules are more than namespaces, and are thereby more flexible
while still solving the same problems as namespaces. Thus it may not be
Ruby that needs to change (to add explicit namespaces), but our
perspective of it.
I haven't fully thought through the module v. namespace distinction,
but these are my current thoughts. Discuss
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.