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

Law of good style for CLOS

    Date: Fri, 27 May 88 23:03:42 EDT
    From: karl lieberherr <lieber@corwin.ccs.northeastern.edu>

    ----- LAW OF DEMETER FOR CLOS (object version)----------
    All function calls (whether generic or not) inside a method M must have
    one of the following objects passed by their first argument:
	a value of M's parameters or
	an immediate part (the value of a slot) of the first argument.
    (Objects created by the method and objects in global variables
    are viewed as being transmitted by arguments.)

So this code would be in violation:

(defmethod iconify ((window special-window) (screen screen))
  (set-top-left-position window *next-left-coordinate* *next-top-coordinate*)
  (incf *next-left-coordinate* *standard-icon-position-x-increment*)
  (incf *next-top-coordinate*  *standard-icon-position-y-increment*))

since the INCFs would expand into (setf var (+ var var1)), and the
arguments to plus would be the values of some special variables
(presumably numbers)?