src/method-{proto,impl}.lisp: Abstract out the receiver type.
[sod] / src / c-types-proto.lisp
index 0c95d02..0ce2cf3 100644 (file)
 
 (export 'canonify-qualifiers)
 (defun canonify-qualifiers (qualifiers)
-  "Return a canonical list of qualifiers."
-  (delete-duplicates (sort (copy-list qualifiers) #'string<)))
+  "Return a canonical list of qualifiers.
+
+   Duplicates and `nil' entries are deleted, and the remaining entries are
+   sorted."
+  (sort (delete-duplicates (delete nil (copy-list qualifiers))) #'string<))
 
 (export 'qualify-c-type)
 (defgeneric qualify-c-type (type qualifiers)
                             ((char= ch #\-)
                              (write-char #\_ out))
                             (t
-                             (error "Bad character in C name ~S." name))))))
+                             (error "Bad character in C name ~S" name))))))
     (t name)))
 
 ;;;--------------------------------------------------------------------------
 ;;;--------------------------------------------------------------------------
 ;;; Function arguments.
 
-(export '(argument argumentp make-argument argument-name argument-type))
-(defstruct (argument (:constructor make-argument (name type
+(export '(argument argumentp make-argument
+         argument-name argument-type argument-default))
+(defstruct (argument (:constructor make-argument (name type &optional default
                                                  &aux (%type type)))
                     (:predicate argumentp))
   "Simple structure representing a function argument."
   (name nil :type t :read-only t)
-  (%type nil :type c-type :read-only t))
+  (%type nil :type c-type :read-only t)
+  (default nil :type t :read-only t))
 (define-access-wrapper argument-type argument-%type :read-only t)
 
 (export 'commentify-argument-name)