From: Tim Vaughan Date: Tue, 1 Nov 2016 08:44:18 +0000 (+1300) Subject: Very basic macros working. X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=scheme.forth.jl.git;a=commitdiff_plain;h=050cc9a7e651ba8eacb054283307f4d06141c302 Very basic macros working. --- 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