+ (e-mail address removed) (Erann Gat):
| In article <
[email protected]>, Harald Hanche-Olsen
|
| > + (e-mail address removed) (Jon S. Anthony):
| >
| > | There's a difference between modules and name spaces, though modules
| > | in many languages also serve as name spaces.
| > [...]
| > So, can anyone either explain the difference, or point to a resource
| > (preferably on the web) that explains it?
|
| Packages map strings onto symbols (identifier objects).
Agreed.
| Modules map symbols/identifiers onto values.
Okay.
| Packages work at read/parse time.
Yep.
| Modules work at compile time or run time depending on the module system.
|
| Common Lisp has a package system but no module system (but it's possible
| to add one -- see e.g.
http://www.flownet.com/gat/locales.pdf).
Ah. I had read that one before, but never realized that it describes
a module system. That gives me some idea what it's all about.
Thanks.
| Python has a module system that works at run-time, but no package system.
|
| Does that help?
Now I am getting a bit confused once more, since python doesn't have
symbols, and so the distinction between modules and packages gets
blurred (in my mind at least): A python modules maps strings directly
to values without symbols ever entering the discussion.
But the read-time vs run-time (or compile-time) distinction makes more
sense to me. If a python function references foo.bar then by changing
the value of foo I can make the function refer to a different foo.bar,
but if a Common Lisp function references foo:bar, then messing around
with the FOO package is never going to change the meaning of that
reference.
I guess what I am saying is that, while packages without symbols don't
make sense, modules don't require them. But then, neither did you
say they do, now that I read what you said over again.