From 1cd6f963ea5062c7f18d2459816cbb8e72ef6245 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sat, 5 Jan 2019 07:44:36 +0100 Subject: [PATCH] Allow setting the status with a Boolean. * gash/environment.scm (set-status!): Allow numerical or boolean input. --- gash/environment.scm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gash/environment.scm b/gash/environment.scm index 519ceaa..6443d3f 100644 --- a/gash/environment.scm +++ b/gash/environment.scm @@ -1,5 +1,6 @@ ;;; Gash -- Guile As SHell ;;; Copyright © 2018, 2019 Timothy Sample +;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen ;;; ;;; 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))