From: Mark Wooding Date: Sat, 27 Jul 2019 00:01:47 +0000 (+0100) Subject: src/pset-impl.lisp: Improve boolean literal handling. X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/sod/commitdiff_plain/5abdef2889c7a9a4eae477afc902ff9b198df6f1 src/pset-impl.lisp: Improve boolean literal handling. * Allow `on' and `off'. * Recognize literals case-insensitively. --- 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 @@ (defun string-to-symbol (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))))) ;;;--------------------------------------------------------------------------