[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: documentation slot option



This issue caused the least excitement of all.  I don't find that
surprising.  No one seems to want to push for it, and no one seems
to want to push against it.

    From: Gregor.pa
    I am mildly opposed to this because I think documentation strings are a
    joke.

    From: Dick Gabriel <RPG@SAIL.Stanford.EDU>
    I have no opinion.

    From: kempf@Sun.COM
    I'm mildly in favor of this, but don't feel particularly strongly about it.


In a situation like this, one argument says, keep the standard small -
don't put it in.  Another argument says, be responsive to criticism -
put it in.

I suggest we be responsive to criticism.

Here is a recap of what this slot option does.

This option would provide a documentation string for the automatically
generated :reader or :writer methods for the slot.

So:

(defclass foo ()
     ((x :reader foo-x
	 :reader bar-x
	 :writer foo-x
	 :documentation "the x slot stores the x position")))

would be equivalent to:

(defclass foo ()
     ((x)))

(defmethod foo-x ((foo foo))
  "the x slot stores the x position"
  (slot-value foo 'x))

(defmethod bar-x ((foo foo))
  "the x slot stores the x position"
  (slot-value foo 'x))

(defmethod (setf foo-x) (new-value (foo foo))
  "the x slot stores the x position"
  (setf (slot-value foo 'x) new-value))
-------