From: lawrence.g.mayka
Subject: Re: history of lisp control flow constructs (long)
Date: 
Message-ID: <LGM.91Oct5101428@cbnewsc.ATT.COM>
In article <····@skye.ed.ac.uk> ····@aiai.ed.ac.uk (Jeff Dalton) writes:
    * Every Common Lisp has a way to determine whether an object is
      a defstruct instance and to extract the name of the struct type.
      In KCL, for example, they're si:structurep and si:structure-name.
      Portable code can't use them.

Test whether an object is a DEFSTRUCT instance (in X3J13 Common Lisp,
of course):

	(TYPEP FOO 'STRUCTURE-OBJECT)

Extract name of DEFSTRUCT type (with optional help from X3J13):
	(DECLARE (STRUCTURE-OBJECT FOO))	; Optional hint to compiler
	(TYPE-OF FOO)

The ideal is that the better Common Lisp compilers would generate
highly efficient code for such cases.  In practice, CL implementors
optimize only the more frequent usage patterns.

   However, more or less the opposite approach was taken with CLOS
   and the CLOS metaobject protocol.  There, the primitives are defined,
   you can specialize them, etc.  CLOS provides a good, and certainly
   less ad hoc, framework for that kind of thing; and the more a Common
   Lisp uses CLOS, the more open and flexible it is likely to be.

Yes, metaobject protocols potentially provide the best of both
approaches: performance *and* flexibility.


	Lawrence G. Mayka
	AT&T Bell Laboratories
	···@iexist.att.com

Standard disclaimer.