projects
/
jscl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b27fcd3
)
let as transformation
author
David Vazquez
<davazp@gmail.com>
Sun, 16 Dec 2012 04:07:13 +0000
(
04:07
+0000)
committer
David Vazquez
<davazp@gmail.com>
Sun, 16 Dec 2012 04:07:13 +0000
(
04:07
+0000)
lispstrack.lisp
patch
|
blob
|
history
test.lisp
patch
|
blob
|
history
diff --git
a/lispstrack.lisp
b/lispstrack.lisp
index
abc1b2b
..
386caed
100644
(file)
--- 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
(file)
--- 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))