src/: Abolish the distinction between different kinds of initializers.
[sod] / src / classes.lisp
index d403d10..1a3a925 100644 (file)
                           (sod-slot-name slot)))))
 
 (export '(sod-initializer sod-initializer-slot sod-initializer-class
-         sod-initializer-value-kind sod-initializer-value-form))
+         sod-initializer-value))
 (defclass sod-initializer ()
   ((slot :initarg :slot :type sod-slot :reader sod-initializer-slot)
    (location :initarg :location :initform (file-location nil)
             :type file-location :reader file-location)
    (%class :initarg :class :type sod-class :reader sod-initializer-class)
-   (value-kind :initarg :value-kind :type keyword
-              :reader sod-initializer-value-kind)
-   (value-form :initarg :value-form :type c-fragment
-              :reader sod-initializer-value-form))
+   (value :initarg :value :type c-fragment :reader sod-initializer-value))
   (:documentation
    "Provides an initial value for a slot.
 
      * The LOCATION states the position in the user's source file where the
        initializer was found.  This gets used in error messages.  (Depending
        on the source layout style, this might differ from the location in the
-       VALUE-FORM C fragment.)
+       VALUE C fragment.)
 
      * The CLASS states which class defined this initializer.  For instance
        slot initializers (`sod-instance-initializer'), this will be the same
        initializers (`sod-class-initializer'), this will be an instance of
        the SLOT's class, or an instance of one of its descendants.
 
-     * The VALUE-KIND states what manner of initializer we have.  It can be
-       either `:single', indicating a standalone expression, or `:compound',
-       indicating a compound initializer which must be surrounded by braces
-       on output.
-
-     * The VALUE-FORM gives the text of the initializer, as a C fragment.
+     * The VALUE gives the text of the initializer, as a C fragment.
 
    Typically you'll see instances of subclasses of this class in the wild
    rather than instances of this class directly.  See `sod-class-initializer'
    and `sod-instance-initializer'."))
 
 (defmethod print-object ((initializer sod-initializer) stream)
-  (with-slots (slot value-kind value-form) initializer
+  (with-slots (slot value) initializer
     (if *print-escape*
        (print-unreadable-object (initializer stream :type t)
-         (format stream "~A = ~A" slot value-form))
-       (format stream "~:[{~A}~;~A~]" (eq value-kind :single) value-form))))
+         (format stream "~A = ~A" slot value))
+       (format stream "~A" value))))
 
 (export 'sod-class-initializer)
 (defclass sod-class-initializer (sod-initializer)
 
    A class slot initializer provides an initial value for a slot in the class
    object (i.e., one of the slots defined by the class's metaclass).  Its
-   VALUE-FORM must have the syntax of an initializer, and its consituent
+   VALUE must have the syntax of an initializer, and its consituent
    expressions must be constant expressions.
 
    See `sod-initializer' for more details."))
    "Provides an initial value for a slot in all instances.
 
    An instance slot initializer provides an initial value for a slot in
-   instances of the class.  Its VALUE-FORM must have the syntax of an
-   initializer.  Furthermore, if the slot has aggregate type, then you'd
-   better be sure that your compiler supports compound literals (6.5.2.5)
-   because that's what the initializer gets turned into.
+   instances of the class.  Its VALUE must have the syntax of an initializer.
+   Furthermore, if the slot has aggregate type, then you'd better be sure
+   that your compiler supports compound literals (6.5.2.5) because that's
+   what the initializer gets turned into.
 
    See `sod-initializer' for more details."))