something akin to Java's "package" in libraries
Hal Daume III
hdaume@ISI.EDU
Wed, 27 Feb 2002 11:07:22 -0800 (PST)
I vaguely recall a brief discussion of this long ago, but don't see any
reference to it on the libraries web page. What I had in mind is
something like:
> package Graphics.GL
> module Foo (...)
> where
>
> import X
> import Bar.Y
> import Z
> ...
where the first conversion is
module-name <- package-name ++ "." ++ module-name
the larger issue would be how to convert imports to qualified imports (and
module exports to qualified exports). i think (only my opinion) that
something like:
import X
should be qualified to
import Graphics.GL.X as X
unless Graphics.GL.X doesn't exist, in which case it gets defaulted to
import X
,
similarly for Bar.Y, gets qualified to:
import Graphics.GL.Bar.Y as Y
unless that doesn't exist, in which case it stays as it is.
i suppose this presents a problem if there's a module Y in your package
and a module Y which isn't and you want to only import the other one. i'm
not entirely sure how java handles this, but from my fairly extensive
experience in java, it's done well and i never had any problems with it in
50k+ loc.
has this been discussed/considered at all?
- Hal
--
Hal Daume III
"Computer science is no more about computers | hdaume@isi.edu
than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume