Allow setting the status with a Boolean.

* gash/environment.scm (set-status!): Allow numerical or boolean input.
This commit is contained in:
Jan Nieuwenhuizen 2019-01-05 07:44:36 +01:00 committed by Timothy Sample
parent 18aefdda18
commit 1cd6f963ea
1 changed files with 7 additions and 1 deletions

View File

@ -1,5 +1,6 @@
;;; Gash -- Guile As SHell
;;; Copyright © 2018, 2019 Timothy Sample <samplet@ngyro.com>
;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;;
;;; This file is part of Gash.
;;;
@ -71,7 +72,12 @@
(define (set-status! n)
"Set the current status."
(set! *status* n))
(match n
((? number?)
(set! *status* n))
(#t (set-status! 0))
(#f (set-status! 1))
(_ (throw 'invalid-status n))))
(define *root-pid* (getpid))