branch: elpa/geiser-gauche
commit 6da3f0224d488a682c898f0d65c308199c63c83f
Author: András Simonyi <[email protected]>
Commit: András Simonyi <[email protected]>
Fix geiser:eval
---
geiser.scm | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/geiser.scm b/geiser.scm
index 0388a2e..9e7cd69 100644
--- a/geiser.scm
+++ b/geiser.scm
@@ -29,12 +29,19 @@
(with-output-to-string
(cut pprint (macroexpand form))))
+
(define (geiser:eval module-name form . rest)
- (let ((module (or (and (symbol? module-name )
+ rest
+ (let* ((output (open-output-string))
+ (module (or (and (symbol? module-name )
(find-module module-name))
- (find-module 'user))))
- (with-output-to-string
- (cut eval form module))))
+ (find-module 'user)))
+ (result (with-output-to-port output
+ (lambda ()
+ (eval form module)))))
+ (write `((result ,(write-to-string result))
+ (output . ,(get-output-string output))))))
+
(define (geiser:autodoc ids . rest)
(map (cut ~ <> 'info)
@@ -68,3 +75,4 @@
(cut string-prefix? prefix <>)
(map (^x (symbol->string (module-name x)))
(all-modules))))
+