From: David Vazquez Date: Sun, 16 Dec 2012 04:07:13 +0000 (+0000) Subject: let as transformation X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=2f34bc47948880d48086a4729e88317f50740a8a;p=jscl.git let as transformation --- diff --git a/lispstrack.lisp b/lispstrack.lisp index abc1b2b..386caed 100644 --- a/lispstrack.lisp +++ b/lispstrack.lisp @@ -167,6 +167,10 @@ (define-transformation progn (&rest body) `((lambda () ,@body))) +(define-transformation let (bindings &rest body) + `((lambda ,(mapcar 'car bindings) ,@body) + ,@(mapcar 'cadr bindings))) + ;;; aritmetic primitives (define-compilation + (x y) (concat "((" (ls-compile x env fenv) ") + (" (ls-compile y env fenv) "))")) diff --git a/test.lisp b/test.lisp index 0f19c5f..b5f0437 100644 --- a/test.lisp +++ b/test.lisp @@ -57,6 +57,9 @@ (debug (progn 1 2 3 123)) +(debug (let ((x 99999)) + (incf x))) + ;;; &rest lambda-list (debug (lambda (&rest x) x))