[erlang-questions] Package Support/Use

Thomas Lindgren thomasl_erlang@REDACTED
Tue Nov 7 15:22:09 CET 2006



--- Richard Carlsson <richardc@REDACTED> wrote:


> But what I think you were looking for, was to have a
> way of
> getting the full name of a "local" module as an
> atom, given
> only its unqualified name. In fact, I had
> experimentally included
> a pseudo-BIF 'expanded(Atom)' (or some such name) -
> expanded at
> compile time, if possible. But at the time, I was a
> bit afraid to
> add a new predefined name and was not sure how
> useful it would turn
> out to be, so it was never included in the system.
> Mea culpa, I guess.
> 
> But it is not too late to add such an operator now.
> Its semantics
> could easily be defined in terms of the full name of
> the containing
> module, i.e., the value of ?MODULE, and a couple of
> the name-
> manipulation functions in the 'packages' kernel
> module. Making the
> compiler recognize and expand it statically when
> possible, is quite
> simple, and can be done regardless of whether the
> function is
> automatically imported or not. Any name suggestions?

Doing so would remove that objection, at least, so I
recommend it. In that case, I'd say an expanded name
should (of course) expand to itself, and also suggest
that operations which expect module names should
always logically behave as if they first expand the
name. If the compiler can do it statically, so much
the better. (NB: this may not be a complete or working
solution. Caveat lector.)

However, I can't promise such an operator will
convince me to actually use packages. I too have an
uneasy suspicion that the whole concept needs further
thinking, and perhaps "legacy Erlang" is not the
vehicle for this. But that's an issue for another
time. 

Best,
Thomas




 
____________________________________________________________________________________
Cheap talk?
Check out Yahoo! Messenger's low PC-to-Phone call rates.
http://voice.yahoo.com



More information about the erlang-questions mailing list