[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Law of good style for CLOS
- To: karl lieberherr <lieber@corwin.ccs.northeastern.edu>
- Subject: Re: Law of good style for CLOS
- From: Scott.Fahlman@B.GP.CS.CMU.EDU
- Date: Thu, 26 May 88 20:36:17 EDT
- Cc: commonloops.pa@Xerox.COM
- In-reply-to: Your message of Thu, 26 May 88 15:37:02 -0400. <8805261937.AA22252@corwin.CCS.Northeastern.EDU>
- Redistributed: commonloops.pa
We have identified the following law of good style (known in-house
as the Law of Demeter) for CLOS programmers:
----------------------------------------------------------------
All generic function calls inside a method M must have
one of the following objects passed by their first argument:
a value of M's parameters (including self) or
an immediate part of self.
Objects created by the method and non-local objects
are viewed as being transmitted by arguments.
self is the name of the first argument of method M.
----------------------------------------------------------------
I have a better law of good style: someone writing Common Lisp code,
whether within a method or not, should not have to be aware of which calls
are generic and which are not. Therefore it is unreasonable to lay down
laws about what the arguments to generic function calls may be.
Do you disagree with this?
-- Scott