diff --git a/lib/chibi/repl.scm b/lib/chibi/repl.scm index 7226f9fb..5da914ab 100644 --- a/lib/chibi/repl.scm +++ b/lib/chibi/repl.scm @@ -1,5 +1,5 @@ ;; repl.scm - friendlier repl with line editing and signal handling -;; Copyright (c) 2012-2013 Alex Shinn. All rights reserved. +;; Copyright (c) 2012-2024 Alex Shinn. All rights reserved. ;; BSD-style license: http://synthcode.com/license.txt ;;> A user-friendly REPL with line editing and signal handling. The @@ -407,6 +407,11 @@ (define-method (repl-print obj (out output-port?)) (write/ss obj out)) +(define-generic repl-print-exception) + +(define-method (repl-print-exception obj (out output-port?)) + (print-exception obj out)) + (define (repl/eval rp expr-list) (let ((thread (current-thread)) (out (repl-out rp))) @@ -416,7 +421,7 @@ (lambda () (protect (exn (else - (print-exception exn out) + (repl-print-exception exn out) (repl-advise-exception exn (current-error-port)))) (for-each (lambda (expr) diff --git a/lib/chibi/repl.sld b/lib/chibi/repl.sld index 3e3ff957..781bd1b5 100644 --- a/lib/chibi/repl.sld +++ b/lib/chibi/repl.sld @@ -1,6 +1,7 @@ (define-library (chibi repl) - (export repl repl-print $0 $1 $2 $3 $4 $5 $6 $7 $8 $9) + (export repl repl-print repl-print-exception + $0 $1 $2 $3 $4 $5 $6 $7 $8 $9) (import (chibi) (only (meta) load-module module-name->file) (chibi ast) (chibi modules) (chibi doc) (chibi generic) (chibi string) (chibi io) (chibi optional)