commit aecdddc985af9f318dd3c718689278d00c6061fe
parent 8282ad61617646eca8849fc67b9f44beec696b57
Author: Bertrand BRUN <bertrand.brun@me.com>
Date: Mon, 1 Nov 2010 18:59:07 +0100
Lisp2li reconnait maintenant le LET
Diffstat:
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/lisp2li.lisp b/lisp2li.lisp
@@ -46,8 +46,14 @@ par le compilateur et par l’interpréteur"
(cons :lit (second expr))
(cons :lit (third expr))))))
((eq 'let (car expr)) ;; Idee de Georges : (let ((x 1) (y 2) (z 3)) (list x y z)) === ((lambda (x y z) (list x y z)) 1 2 3)
- (push-new-env env "LET")
- (map-lisp2li-let expr env))
+ ; Premiere Version
+ ; (push-new-env env "LET")
+ ; (map-lisp2li-let expr env))
+ (let ((bindings (cadr expr))
+ (body (cddr expr)))
+ (lisp2li `((lambda ,(mapcar #'car bindings)
+ ,@body)
+ ,@(mapcar #'cadr bindings)) env)))
((macro-function (car expr))
(lisp2li (macroexpand-1 expr) env)) ; macros
((not (special-operator-p (car expr))) ; fonctions normales.