mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-19 19:20:23 +02:00
* throw.h: prototype for scm_exit_status.
* throw.c (scm_handle_by_message): if a 'quit is caught, use its args to derive an exit status. Allows (quit) to work from a script. (scm_exit_status): new function. #include "eq.h".
This commit is contained in:
parent
8e44e7a0c7
commit
1a36eef2ea
5 changed files with 34 additions and 12 deletions
|
@ -4,9 +4,7 @@ Sun Mar 2 05:25:11 1997 Gary Houston <ghouston@actrix.gen.nz>
|
|||
return the quit args.
|
||||
(scm-style-repl): call -quit, passing return value from
|
||||
error-catching-repl. Make -quit return its args.
|
||||
stand-along-repl: comment out, since it seems unused.
|
||||
(top-repl): convert the value returned by scm-style-repl to
|
||||
an integer and return it.
|
||||
stand-alone-repl: comment out, since it seems unused.
|
||||
|
||||
(error-catching-loop thunk): discard trailing junk after a (quit).
|
||||
|
||||
|
|
|
@ -2455,15 +2455,7 @@
|
|||
;; (set-current-error-port errp)
|
||||
|
||||
(define (top-repl)
|
||||
;; scm-style-repl returns the list of arguments from quit: convert to
|
||||
;; an integer status and return.
|
||||
(let ((quit-args (scm-style-repl)))
|
||||
(if (null? quit-args)
|
||||
0
|
||||
(let ((cqa (car quit-args)))
|
||||
(cond ((number? cqa) cqa)
|
||||
((eq? cqa #f) 1)
|
||||
(else 0))))))
|
||||
(scm-style-repl))
|
||||
|
||||
(defmacro false-if-exception (expr)
|
||||
`(catch #t (lambda () ,expr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue