summaryrefslogtreecommitdiff
path: root/scheme/plt/geiser/eval.ss
diff options
context:
space:
mode:
Diffstat (limited to 'scheme/plt/geiser/eval.ss')
-rw-r--r--scheme/plt/geiser/eval.ss7
1 files changed, 7 insertions, 0 deletions
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)