From 1945dbf8345a2b59e9057d21e38c78913272bdaa Mon Sep 17 00:00:00 2001 From: kartofen Date: Sat, 16 Nov 2024 17:20:23 +0200 Subject: cleanup and minor refactoring --- files/test-lambda.l | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'files') 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))) -- cgit v1.2.3