[Prev][Next][Index][Thread]

Re: A basic question: defining modules and libraries



Scott McKay <swm@mediaone.net> wrote:
> Neel Krishnaswami wrote in message ...
> >Andreas Bogk <andreas@andreas.org> wrote:
> >> neelk@brick.cswv.com (Neel Krishnaswami) writes:
> >> > I dunno why modules don't nest, though. Maybe there are theoretical
> >>
> >> What do you mean by 'nesting'? It is possible to combine several
> >> modules to a single module.
> >
> >I guess I mean a hierarchical namespace, kind of like the way a
> >filesystem partitions names.
> 
> I'm curious as to what you would do with this.

Nothing -- it was an idle thought, really. It was spurred by the
comment that the "intuitive" number of namespace levels was either
zero (no module system), one (a flat package namespace), or infinity
(a hierarchical namespace of arbitrary depth).

I'm actually quite happy with Dylan's module system. The only addition
I could ask for is parameterized modules, and that's more out of a
desire to "keep up with the ML Joneses" than any actual utility. :)

(This (ie, no use for functors) might have been predicted from the
fact that the Haskell crowd seems to use overloading where ML
programmers use functors, and Dylan's generic functions also offer a
very convenient mechanism for (late-bound) overloading.)

> Would a name look like 'Dylan/Complex/add'.  If so, couldn't
> you just use 'prefix:' to get this effect?

Yes. I just double-checked, and found that Java uses convention to
partition the namespace rather than a language-level mechanism.


Neel



Follow-Ups: References: