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

"lexical" packages


OK, now I think I understand what you're saying, as far as it goes.
This is very similar to what the Symbolics people were just arguing for:
that all of the package stuff happens at the start of a file, and the
"scope" within which a package is the default for the reader is one

I'm basically in sympathy with the idea that you don't change the
package environment in the middle of a file.  Right now, I can't think
of any situation in which I'd really want to change packages within a
file.  So far, so good.

I think that I would often want to load N files, some of which go into
package A and some of which go into package B in any order.  There's no
problem with this as long as each file going into a certain package has
identical (or maybe just compatible) package stuff at the start.  To me,
this isn't exactly lexical, as I understand the term, but there's no
point in quibbling about terminology.

What I don't understand about your proposal is how one deals with
input to the reader that is not in the form of a file, with its natural
lexical boundaries.  How do we handle terminal input, input from streams
whose source is unknown to the Lisp, and so on, if not dynamically?

If the essence of your proposal is that we handle packages more as less
as we do now, except that IN FILES the package forms must all occur at
the start and the system can take their scope to be the whole file,
that's worth some careful study.  It certainly is good style in all the
situations I can think of, so maybe enforcing it wouldn't be so bad.
However, this sort of messes up the abstraction that Lisp just sucks
streams into the reader and that the reader doesn't care where the stuff
is coming from.

-- Scott