That's because there are different ways to implement a let operator,
that different lisps had different behavior there.
Common Lisp mostly defined a greatest common denominator of all lisp
practices current at the time.
Notice that Common Lisp doesn't specify that (let ((a 100)(a 200)) a)
should return 200. It is undefined by the standard. It could as well
return 100. Or something else:
[pjb@kuiper :0 Body]$ clall -r '(let ((a 100) (a 200)) a)'
International Allegro CL Free Express Edition --> 100
Clozure Common Lisp --> 200
CLISP --> 200
CMU Common Lisp Repeated variable in lambda-list: A.
ECL --> 100
SBCL Execution of a form compiled with errors. Form: (LET ((A 100) (A 200)) A) Compile-time error: The variable A occurs more than once in the LET.
In CL, (let ((a 100) (a 200)) a) is non conforming code, and should
not be used.
Another difference between scheme and CL let, is that in CL, the
evaluation of the initialization forms is done from left to right, while
the order is not determined in scheme.
In scheme:
(let ((a 1))
(let ((b (begin (set! a (+ 1 a)) a))
(c (begin (set! a (+ 1 a)) a)))
(list b c)))
--> 2 3 ; or
--> 3 2
In CL,
(let ((a 1))
(let ((b (incf a))
(c (incf a)))
(list b c)))
--> 2 3
But notice how a scheme program can be as well a CL conforming program.
Since the order of evaluation is not specified in scheme, and since the
presence of duplicate variables is not specified in CL, you can write a
scheme let form that is a valid CL form.
--
__Pascal Bourguignon__
http://www.informatimago.com/
A bad day in () is better than a good day in {}.