From 5abdef2889c7a9a4eae477afc902ff9b198df6f1 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sat, 27 Jul 2019 01:01:47 +0100 Subject: [PATCH] src/pset-impl.lisp: Improve boolean literal handling. * Allow `on' and `off'. * Recognize literals case-insensitively. --- src/pset-impl.lisp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pset-impl.lisp b/src/pset-impl.lisp index e6986a5..f938ad3 100644 --- a/src/pset-impl.lisp +++ b/src/pset-impl.lisp @@ -74,12 +74,12 @@ (error "Symbol `~A' not external in package `~A'" name (package-name package))))))))) -(let ((truish '("true" "t" "yes" "verily")) - (falsish '("false" "nil" "no" "nowise"))) +(let ((truish '("true" "t" "yes" "on" "verily")) + (falsish '("false" "nil" "no" "off" "nowise"))) (defun truishp (string) "Convert STRING to a boolean." - (cond ((member string truish :test #'string=) t) - ((member string falsish :test #'string=) nil) + (cond ((member string truish :test #'string-equal) t) + ((member string falsish :test #'string-equal) nil) (t (error "Unrecognized boolean value `~A'" string))))) ;;;-------------------------------------------------------------------------- -- 2.11.0