mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-20 14:19:18 +02:00
The argument to exit is optional, and is treated as 1 for any non-integer
("error" for any non-string on plan9). The idiom (exit #f) can be used to indicate an arbitrary error.
This commit is contained in:
parent
37b796e0f0
commit
05d416e17f
2 changed files with 11 additions and 1 deletions
|
@ -1,4 +1,12 @@
|
||||||
|
|
||||||
|
(cond-expand
|
||||||
|
(plan9
|
||||||
|
(define (exit . o)
|
||||||
|
(%exit (if (pair? o) (if (string? (car o)) (car o) "error") ""))))
|
||||||
|
(else
|
||||||
|
(define (exit . o)
|
||||||
|
(%exit (if (pair? o) (if (integer? (car o)) (car o) 1) 0)))))
|
||||||
|
|
||||||
(cond-expand
|
(cond-expand
|
||||||
(bsd
|
(bsd
|
||||||
(define (process-command-line pid)
|
(define (process-command-line pid)
|
||||||
|
|
|
@ -117,7 +117,9 @@
|
||||||
|
|
||||||
;;> Exits the current process immediately. Finalizers are not run.
|
;;> Exits the current process immediately. Finalizers are not run.
|
||||||
|
|
||||||
(define-c void exit (int))
|
(cond-expand
|
||||||
|
(plan9 (define-c void (%exit exit) (string)))
|
||||||
|
(else (define-c void (%exit exit) (int))))
|
||||||
|
|
||||||
;;> Replace the current process with the given command. Finalizers
|
;;> Replace the current process with the given command. Finalizers
|
||||||
;;> are not run.
|
;;> are not run.
|
||||||
|
|
Loading…
Add table
Reference in a new issue