From 050cc9a7e651ba8eacb054283307f4d06141c302 Mon Sep 17 00:00:00 2001 From: Tim Vaughan Date: Tue, 1 Nov 2016 21:44:18 +1300 Subject: [PATCH] Very basic macros working. --- scheme-library.scm | 5 +++-- scheme.4th | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/scheme-library.scm b/scheme-library.scm index dc345cf..b92795d 100644 --- a/scheme-library.scm +++ b/scheme-library.scm @@ -28,11 +28,12 @@ (append (reverse (cdr l)) (list (car l))))) ;; LIBRARY FORMS -(define-macro (let value . body ) - (list (list 'lambda (list (car value)) body)) (cdr value)) ;; TESTING +(define-macro (backwards . body) + (cons 'begin (reverse body))) + ; Basic iterative summation. Run this on large numbers to ; test garbage collection and tail-call optimization. (define (sum n) diff --git a/scheme.4th b/scheme.4th index 1d06ea6..24937a2 100644 --- a/scheme.4th +++ b/scheme.4th @@ -1361,9 +1361,7 @@ hide env ( env exp env opname mproc ) 2swap 2drop -2rot 2drop cdr ( env mproc body ) - 2dup print cr macro-expand - 2dup print cr 2swap ['] eval goto-deferred -- 2.20.1