chiark / gitweb /
src/method-impl.lisp, etc.: Add a `readonly' message property.
[sod] / src / classes.lisp
index 678d4a51fe8bf1a762880b17d6f7e88ad42ee6dd..69df4d1e78270062633083dddc80d03c8401aed2 100644 (file)
@@ -366,11 +366,14 @@ (defmethod print-object ((initarg sod-slot-initarg) stream)
 ;;;--------------------------------------------------------------------------
 ;;; Messages and methods.
 
-(export '(sod-message sod-message-name sod-message-class sod-message-type))
+(export '(sod-message sod-message-name sod-message-readonly-p
+         sod-message-class sod-message-type))
 (defclass sod-message ()
   ((name :initarg :name :type string :reader sod-message-name)
    (location :initarg :location :initform (file-location nil)
             :type file-location :reader file-location)
+   (readonlyp :initarg :readonly :initform nil :type t
+             :reader sod-message-readonly-p)
    (%class :initarg :class :type sod-class :reader sod-message-class)
    (%type :initarg :type :type c-function-type :reader sod-message-type))
   (:documentation
@@ -403,6 +406,10 @@ (defclass sod-message ()
      * The `location' states where in the user's source the slot was defined.
        It gets used in error messages.
 
+     * The `readonly' flag indicates whether the message receiver can modify
+       itself in response to this message.  If set, the receiver will be
+       declared `const'.
+
      * The `class' states which class defined the message.
 
      * The `type' is a function type describing the message's arguments and