From 2f34bc47948880d48086a4729e88317f50740a8a Mon Sep 17 00:00:00 2001 From: David Vazquez Date: Sun, 16 Dec 2012 04:07:13 +0000 Subject: [PATCH] let as transformation --- lispstrack.lisp | 4 ++++ test.lisp | 3 +++ 2 files changed, 7 insertions(+) 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)) -- 1.7.10.4