mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
multiple-values help for the repl; exports cleanups
* module/system/repl/command.scm (system): Declare exports in the module declaration. * module/system/repl/repl.scm (start-repl): If the evaluation returns multiple values, print them separately.
This commit is contained in:
parent
f540e3271b
commit
b79f118f8e
2 changed files with 5 additions and 3 deletions
|
@ -34,7 +34,8 @@
|
|||
:use-module (ice-9 format)
|
||||
:use-module (ice-9 session)
|
||||
:use-module (ice-9 documentation)
|
||||
:use-module (ice-9 and-let-star))
|
||||
:use-module (ice-9 and-let-star)
|
||||
:export (meta-command))
|
||||
|
||||
|
||||
;;;
|
||||
|
@ -100,7 +101,7 @@
|
|||
(let ((abbrev (if abbrev (format #f "[,~A]" abbrev) "")))
|
||||
(format #t " ,~24A ~8@A - ~A\n" usage abbrev summary)))
|
||||
|
||||
(define-public (meta-command repl line)
|
||||
(define (meta-command repl line)
|
||||
(let ((input (call-with-input-string (string-append "(" line ")") read)))
|
||||
(if (not (null? input))
|
||||
(do ((key (car input))
|
||||
|
|
|
@ -39,7 +39,8 @@
|
|||
(begin (read-char) (meta-command repl (read-line)))
|
||||
;; evaluation
|
||||
(let rep-loop ()
|
||||
(repl-print repl (repl-eval repl (repl-read repl)))
|
||||
(call-with-values (lambda () (repl-eval repl (repl-read repl)))
|
||||
(lambda l (for-each (lambda (v) (repl-print repl v)) l)))
|
||||
(if (next-char #f) (rep-loop)))))
|
||||
(lambda (key fun msg args)
|
||||
(display "ERROR: ")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue