chiark / gitweb /
src/codegen-proto.lisp (definst): Overhaul argument-list processing.
[sod] / src / pset-impl.lisp
index e6986a5b91bccf384890ac66d61646534b16505e..338306aca5943c907382a08b4731c0e9699d3040 100644 (file)
@@ -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)))))
 
 ;;;--------------------------------------------------------------------------
@@ -88,6 +88,16 @@   (defun truishp (string)
 (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