summaryrefslogtreecommitdiff
path: root/module/system/repl/repl.scm
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2010-07-10 12:21:50 +0200
committerAndy Wingo <wingo@pobox.com>2010-07-10 12:21:50 +0200
commit5273854080c0536563ca1538716a1e18dfde187b (patch)
tree260d25c331504b94c29b5aac6a44160ed205b33d /module/system/repl/repl.scm
parentdc3b2661183786587350b19b97aefeec556cc54e (diff)
downloadguile-5273854080c0536563ca1538716a1e18dfde187b.tar.gz
finally, backtraces only showing frames for the computation
* module/system/repl/repl.scm (run-repl): Run the thunk in a stack in a prompt, similar to the default prompt. Gives proper backtraces. * module/system/repl/error-handling.scm (call-with-error-handling): Narrow one more outer frame, for the %start-stack thunk invocation. * module/ice-9/boot-9.scm (%start-stack): Reindent.
Diffstat (limited to 'module/system/repl/repl.scm')
-rw-r--r--module/system/repl/repl.scm8
1 files changed, 7 insertions, 1 deletions
diff --git a/module/system/repl/repl.scm b/module/system/repl/repl.scm
index fba67764f..21998ba5d 100644
--- a/module/system/repl/repl.scm
+++ b/module/system/repl/repl.scm
@@ -106,6 +106,12 @@
(abort))))))
(define (run-repl repl)
+ (define (with-stack-and-prompt thunk)
+ (call-with-prompt (default-prompt-tag)
+ (lambda () (start-stack #t (thunk)))
+ (lambda (k proc)
+ (with-stack-and-prompt (lambda () (proc k))))))
+
(% (with-fluids ((*repl-stack*
(cons repl (or (fluid-ref *repl-stack*) '()))))
(if (null? (cdr (fluid-ref *repl-stack*)))
@@ -140,7 +146,7 @@
(repl-parse repl exp))))))
(run-hook before-eval-hook exp)
(with-error-handling
- (start-stack #t (% (thunk)))))
+ (with-stack-and-prompt thunk)))
(lambda (k) (values))))
(lambda l
(for-each (lambda (v)