From 53f1b00552be4057af7c0ef19d708bb2bbf86952 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sun, 3 May 2009 01:21:03 +0200 Subject: PLT: simple macroexpand. --- scheme/plt/geiser/eval.ss | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scheme/plt/geiser/eval.ss') diff --git a/scheme/plt/geiser/eval.ss b/scheme/plt/geiser/eval.ss index 0490c1e..2345e14 100644 --- a/scheme/plt/geiser/eval.ss +++ b/scheme/plt/geiser/eval.ss @@ -30,6 +30,7 @@ compile-in load-file compile-file + macroexpand make-repl-reader) (require scheme/enter srfi/13) @@ -115,6 +116,12 @@ (define compile-file load-file) +(define (macroexpand form . all) + (let ((all (and (not (null? all)) (car all)))) + (with-output-to-string + (lambda () + (pretty-print (syntax->datum ((if all expand expand-once) form))))))) + (define (make-repl-reader builtin-reader) (lambda (ns) (last-namespace ns) -- cgit v1.2.3