src/pset-impl.lisp: Accept `yup' and `nope' as booleans.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 12 Aug 2019 10:14:01 +0000 (11:14 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 12 Aug 2019 11:40:24 +0000 (12:40 +0100)
I may draw the line at `yarp' and `narp'.

doc/syntax.tex
src/pset-impl.lisp

index 30fcdfb..07b7ce7 100644 (file)
@@ -462,10 +462,10 @@ above, are as follows.
 
 \item The @|boolean| output type denotes a boolean value, which may be either
   true or false.  A value of type @|id| is considered true if it is @|true|,
-  @|t|, @|yes|, @|on|, or @|verily|; or false if it is @|false|, @|nil|,
-  @|no|, @|off|, or @|nowise|; it is erroneous to provide any other
-  identifier where a boolean value is wanted.  A value of type @|int| is
-  considered true if it is nonzero, or false if it is zero.
+  @|t|, @|yes|, @|on|, @|yup|, or @|verily|; or false if it is @|false|,
+  @|nil|, @|no|, @|off|, @|nope|, or @|nowise|; it is erroneous to provide
+  any other identifier where a boolean value is wanted.  A value of type
+  @|int| is considered true if it is nonzero, or false if it is zero.
 
 \item The @|symbol| output type denotes a Lisp symbol.
 
index f5650cf..42049db 100644 (file)
@@ -75,9 +75,9 @@
                        name (package-name package)))))))))
 
 (let ((truth-map (make-hash-table :test #'equalp)))
-  (dolist (string '("true" "t" "yes" "on" "verily"))
+  (dolist (string '("true" "t" "yes" "on" "yup" "verily"))
     (setf (gethash string truth-map) t))
-  (dolist (string '("false" "nil" "no" "off" "nowise"))
+  (dolist (string '("false" "nil" "no" "off" "nope" "nowise"))
     (setf (gethash string truth-map) nil))
   (defun truishp (string)
     "Convert STRING to a boolean."