aboutsummaryrefslogtreecommitdiff
path: root/files/test-lambda.l
diff options
context:
space:
mode:
authorkartofen <mladenovnasko0@gmail.com>2024-11-16 17:20:23 +0200
committerkartofen <mladenovnasko0@gmail.com>2024-11-16 17:20:23 +0200
commit1945dbf8345a2b59e9057d21e38c78913272bdaa (patch)
tree6f908d5feb358d5deb37e3137684208408a52186 /files/test-lambda.l
parent0dd38d08551ac2fcff53eb604f6363f37b25aef9 (diff)
cleanup and minor refactoringHEADmaster
Diffstat (limited to 'files/test-lambda.l')
-rw-r--r--files/test-lambda.l14
1 files changed, 14 insertions, 0 deletions
diff --git a/files/test-lambda.l b/files/test-lambda.l
index d58169a..3136452 100644
--- a/files/test-lambda.l
+++ b/files/test-lambda.l
@@ -92,3 +92,17 @@
(cond (((= 1 2) 3)
((= 1 (+ 1 1)) (+ 6 2))
(1 (quote test))))
+
+(defmacro begin (vars)
+ (foldr (lambda (var rest) `((lambda (__) ,rest) ,var)) '__ vars))
+
+(begin
+ ((define inc (lambda (a) (+ a 1)))
+ (inc 1)))
+
+(define inc (lambda (a) (+ a 1)))
+
+(begin
+ ((+ 0 1)
+ (define a inc)))
+ ;; (a 1)))