(:constructor %make-property
(name value
&key type location seenp
- &aux (key (property-key name)))))
+ &aux (key (property-key name)) (%type type))))
"A simple structure for holding a property in a property set.
The main useful feature is the ability to tick off properties which have
(name nil :type (or string symbol))
(value nil :type t)
- (type nil :type symbol)
+ (%type nil :type symbol)
(location (file-location nil) :type file-location)
(key nil :type symbol)
(seenp nil :type boolean))
+(define-access-wrapper p-type p-%type)
(export 'decode-property)
(defgeneric decode-property (raw)
(:method ((raw string)) (values :string raw))
(:method ((raw character)) (values :char raw))
(:method ((raw property)) (values (p-type raw) (p-value raw)))
- (:method ((raw cons)) (values (car raw) (cdr raw))))
+ (:method ((raw cons)) (values (car raw) (cdr raw)))
+ (:method ((raw function)) (values :func raw)))
(export 'make-property)
(defun make-property (name raw-value &key type location seenp)
;; If the caller asks for type T then give him the raw thing.
(:method (value type (wanted (eql t)))
+ (declare (ignore type))
value))
;;;--------------------------------------------------------------------------
(defun pset-get (pset key)
"Look KEY up in PSET and return what we find.
- If there's no property by that name, return NIL."
+ If there's no property by that name, return nil."
(values (gethash key (%pset-hash pset))))
(defun pset-store (pset prop)
Otherwise the value is coerced to the right kind of thing (where possible)
and returned.
- If PSET is nil, then return DEFAULT."
+ The file location at which the property was defined is returned as a
+ second value.
+
+ If PSET is nil, then return DEFAULT and nil."
(let ((prop (and pset (pset-get pset (property-key name)))))
(with-default-error-location ((and prop (p-location prop)))
((endp list) pset)
(add-property pset (funcall name list) (funcall value list))))))
-(export 'check--unused-properties)
+(export 'check-unused-properties)
(defun check-unused-properties (pset)
"Issue errors about unused properties in PSET."
(when pset