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

Re: {Improved version} EXPORT-IMPORT and the other random commands



> My experience is that noone wants to qualify any names so what
> they do is carefully use every package that they've ever seen,
> not realizing that 
> 
> (let ((string "abcd"))
>   ....)
> 
> in their code is creating a spec-bind because they are using a package
> where string is a special.
> 
> nuff said.

Not quite enough; I'd say that the blame for this particular lossage
falls squarely on the author of the USEd package, not on the person
USEing it.  Anyone who would proclaim STRING special is a complete bogon.
If it's a global special variable, it should have *'s around it.
If it's a constant, it should either a) have a name less likely to
break the entire world, or b) be SHADOWed and not be EXPORTed.

If someone really wanted to have a global special or a constant called
STRING, (ick) then SHADOWing the symbol would solve (or at least make
clearer) the problem.  If STRING was SHADOWed in the FOO package, and
also EXPORTed from FOO, and BAR tried to USE FOO, an error would be
signalled, because BAR was trying to inherit both FOO:STRING and
LISP:STRING.

I'm not at all sure what the "right" way to deal with packages is, but
I find that life is much easier if package-related activities are kept
to a minimum.  If you have one package per application, then there are
few problems.  It's when you try to interface your application with
someone else's that you get screwed.

Jamie