chiark / gitweb /
src/optparse.lisp, src/classes.lisp: Don't leak slot names.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 26 May 2016 08:26:09 +0000 (09:26 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 22 Jul 2017 17:12:57 +0000 (18:12 +0100)
This were the last slot-name leaks.  Yay!

doc/SYMBOLS
src/classes.lisp
src/optparse.lisp

index cec9fa3023e8782bb238ed69a510df5101d9e8c2..85750bd40f2f61dbfb84c94e9f58b1cabaeec4e9 100644 (file)
@@ -626,9 +626,6 @@ pset-proto.lisp
   store-property                                function
   with-pset-iterator                            macro
 
-Leaked slot names: cl:type
-  sod-initarg: cl:type
-
 Classes:
 cl:t
   sb-pcl::slot-object
@@ -2112,10 +2109,6 @@ optparse.lisp
   cl:string                                     function class c-type opthandler
   with-unix-error-reporting                     macro
 
-Leaked slot names: cl:documentation, options
-  option: cl:documentation
-  option-parser: options
-
 Classes:
 cl:t
   sb-pcl::slot-object
index 3ed103a752c0ecf9c8510743721c0ac0e52fb03a..9484141060402e97cee2514b46e51058bf3c3706 100644 (file)
@@ -331,7 +331,7 @@ (defclass sod-initarg ()
    (location :initarg :location :initform (file-location nil)
             :type file-location :reader file-location)
    (name :initarg :name :type string :reader sod-initarg-name)
-   (type :initarg :type :type c-type :reader sod-initarg-type))
+   (%type :initarg :type :type c-type :reader sod-initarg-type))
   (:documentation
    "Describes a keyword argument accepted by the initialization function."))
 
index 74df161337a5163fca440528fc10ca259c5e56a0..16b5b7be78933ae0777ea707ce06e5ae8d2ff86f 100644 (file)
@@ -166,14 +166,18 @@ (defstruct (option
                          (opt-arg-optional-p o)
                          (opt-arg-name o)
                          (opt-documentation o)))))
-            (:constructor %make-option)
+            (:constructor %make-option
+                (&key long-name tag negated-tag short-name
+                      arg-name arg-optional-p documentation
+                 &aux (%documentation documentation)))
             (:constructor make-option
                 (long-name short-name
                  &optional arg-name
                  &key (tag (intern (string-upcase long-name) :keyword))
                       negated-tag
                       arg-optional-p
-                      doc (documentation doc))))
+                      doc (documentation doc)
+                 &aux (%documentation documentation))))
   "Describes a command-line option.  Slots:
 
    LONG-NAME   The option's long name.  If this is null, the `option' is
@@ -210,7 +214,8 @@ (defstruct (option
   (short-name nil :type (or null character))
   (arg-name nil :type (or null string))
   (arg-optional-p nil :type t)
-  (documentation nil :type (or null string)))
+  (%documentation nil :type (or null string)))
+(define-access-wrapper opt-documentation opt-%documentation)
 
 (export '(option-parser option-parser-p make-option-parser
          op-options op-non-option op-long-only-p op-numeric-p
@@ -225,6 +230,7 @@ (defstruct (option-parser
                       negated-numeric-p
                       long-only-p
                  &aux (args (cons nil argstmp))
+                      (%options options)
                       (next args)
                       (negated-p (or negated-numeric-p
                                      (some #'opt-negated-tag
@@ -258,7 +264,7 @@ (defstruct (option-parser
                still allowed, and may be cuddled as usual.  The default is
                nil."
   (args nil :type list)
-  (options nil :type list)
+  (%options nil :type list)
   (non-option :skip :type (or function (member :skip :stop :return)))
   (next nil :type list)
   (short-opt nil :type (or null string))
@@ -268,6 +274,7 @@ (defstruct (option-parser
   (numeric-p nil :type t)
   (negated-numeric-p nil :type t)
   (negated-p nil :type t))
+(define-access-wrapper op-options op-%options)
 
 (export 'option-parse-error)
 (define-condition option-parse-error (error simple-condition)