Newsgroups: comp.lang.clos
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!bbn.com!jmorrill
From: jmorrill@bbn.com (Jeff Morrill)
Subject: RE: Elements of CLOS Style
Message-ID: <19910627190452.1.JMORRILL@adams.bbn.com>
Sender: daemon@cis.ohio-state.edu
Organization: The Ohio State University Department of Computer and Information Science
Date: Thu, 27 Jun 1991 19:04:00 GMT
Lines: 40

jonl@lucid.com says:
  I rather like the idea of some community-based style guidelines; at the
  very least, it would provide a resevoir of FAQ's -- like, suggesting to
  use PROGN method combination rather than explicit kludges.

  But a couple of explicit comments.

  re: 1.  If it can be done without extending the MOP, don't 
      extend the MOP.
  Do you mean to say "make use of" rather than "extend"?

Better choice of words.  The Meta-Object Protocol is extremely
powerful, and one day (soon?) we will be able to use a portable,
stable version to implement some very interesting behavior.  One
should not use a bazooka to kill a mosquitoe, however, even if it
might work.

  re: 5.  Avoid the use of TYPEP.  

  This would be a very implementation-specific piece of advice, *if*
  the issue you are worried about is running speed.  

Quite true, I hadn't considered speed because these predicates
play such a small role in the overall efficiency of the
programs I write.  "Aggressive" optimization can make TYPEP quite
fast, but from what I've seen, the second argument must be a constant.
Hard-coding a constant makes things faster but less accessible to
programmers who wish to reuse the code.  I should have said:

5.  Avoid the use of TYPEP, except where speed is critical.
     (Speed is not always the most important thing.)

The same can be said for SLOT-VALUE.  Where the second argument
is a constant, one might get really fast slot access, but at
what cost to data encapsulation?

thanks for your insights,

jeff morrill
jmorrill@bbn.com
