[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Law of good style for CLOS
- To: karl lieberherr <lieber@corwin.ccs.northeastern.edu>
- Subject: Law of good style for CLOS
- From: David Vinayak Wallace <Gumby@MCC.COM>
- Date: Sun, 29 May 88 19:25 CDT
- Cc: commonloops.pa@Xerox.COM
- In-reply-to: <8805280303.AA01292@corwin.CCS.Northeastern.EDU>
- Redistributed: commonloops.pa
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)?