Yo Craig,
your message is really hard to read as its formatting is totally
broken. I'll try to reconstruct:
>>>>> "Craig" == Craig Lanning <CraigL(a)internetx.net> writes:
Craig> One example that shows the "symbol names function" vs "symbol
Craig> names variable" problem is
Craig> (let ((cons '()))
Craig> (push "ghengis" cons)
Craig> (push "khubla" cons)
Craig> cons)
Craig> This is a problem in Scheme because CONS is defined to be a
Craig> function for constructing lists. Within this LET it is rebound
Craig> to be a variable holding an empty list. In CL, function and
Craig> variable bindings are separate. CONS is defined as a function
Craig> by the standard, but carries no variable definition [it is
Craig> unbound], therefore, LET is free to establish a local variable
Craig> binding for CONS and PUSH will not be confused because it will
Craig> use the function binding for CONS. This form evaluates
Craig> correctly in CL and EL.
This indeed shows the CONS example to be poor. The point remains the
same, however: What if we bind a variable bound in a macro. Say,
*features*? What if a temporary identifier in a macro definition
shadows a binding in a use?
Craig> One example that can be fixed by use of packages is [Scheme
Craig> form]:
Craig> If the application really needs a function named CONS with
Craig> different behavior [ ... ]that CL's CONS, a new package should be
Craig> defined which shadows the CONS symbol [CL form]:
You're missing the point: When you're using a macro, you don't know
which bindings it refers to. Therefore, you have no handle whatsoever
on using the right package magic in order to avoid capture problems.
In the examples, I don't *need* to use CONS, it just might happen to
be a convenient name.
What I would also want is, that, if a macro is defined within a
certain package, and I refer to bindings from the macro, that these
bindings are relative to the package of definition rather than the
package of use, obeying the standard rules of lexical scoping. Not
having this (as in CL) introduces other dangers.
The fundamental reason for this and many of the other troubles in CL
(and ELisp, for that matter), is the persistent confusion between
symbols and names. Try explaining this mess to a novice in Lisp, and
you'll find out just how confusing it is. Scheme doesn't have this
historical baggage.
--
Cheers =8-} Chipsy
Friede, Völkerverständigung und überhaupt blabla