X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/d448780ebac179cab9e330057357faa93e3053e9..79766c36e3ccde29b7123b203dcf47fbb4864d73:/src/pset-impl.lisp diff --git a/src/pset-impl.lisp b/src/pset-impl.lisp index e6986a5..338306a 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))))) ;;;-------------------------------------------------------------------------- @@ -88,6 +88,16 @@ (defmethod file-location ((prop property)) (file-location (p-location prop))) +;;; Input conversions. + +(defmethod decode-property ((raw symbol)) (values :symbol raw)) +(defmethod decode-property ((raw integer)) (values :int raw)) +(defmethod decode-property ((raw string)) (values :string raw)) +(defmethod decode-property ((raw character)) (values :char raw)) +(defmethod decode-property ((raw function)) (values :func raw)) +(defmethod decode-property ((raw c-type)) (values :type raw)) +(defmethod decode-property ((raw c-fragment)) (values :c-fragment raw)) + ;;; Keywords. (defmethod coerce-property-value