Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbosgd!gatech!seismo!utah-cs!shebs From: shebs@utah-cs.UUCP (Stanley Shebs) Newsgroups: net.lang.lisp Subject: Re: question for a Common Lisp guru Message-ID: <3706@utah-cs.UUCP> Date: Wed, 5-Mar-86 17:35:59 EST Article-I.D.: utah-cs.3706 Posted: Wed Mar 5 17:35:59 1986 Date-Received: Sat, 8-Mar-86 04:32:02 EST References: <1829@hammer.UUCP> <1142@mit-eddie.UUCP> <1840@hammer.UUCP> Reply-To: shebs@utah-cs.UUCP (Stanley Shebs) Distribution: net Organization: University of Utah CS Dept Lines: 41 In article <1840@hammer.UUCP> patcl@hammer.UUCP (Pat Clancy) writes: >In article <1142@mit-eddie.UUCP> barmar@eddie.UUCP (Barry Margolin) writes: >>>There does not seem to be any special form which could be >>>used to implement such a macro [defun]. >> >>It can expand into >> (setf (symbol-value ... > >Unfortunately, setf is itself a macro. So what is the final real >form that that defun expands to? Common Lisp doesn't specify it. Remember, Common Lisp is "just" an interchange standard - Steele's book does *not* describe any particular implementation! So in the case of defun, the implementation is free to expand it into whatever implementation-dependent stuff it feels like producing. Pretty entertaining, no? There *is* one suggested restriction (the note on p.58), that implementations not expand macros into implementation-dependent special forms. Implementation-dependent *functions* are OK tho, and in fact that's what you have to use. (setf (symbol-function ...)) eventually expands into %set-symbol-function or some such. In the case of our Common Lisp (PCLS) which is built on top of PSL, defun eventually turns into a call on the PSL function PutD. Almost all the setf functions are this way. You will find GET, but not PUT - that's because half the existing Lisp implementations use the argument order (put symbol indicator value), and the other half do it as (put symbol value indicator). Common Lisp gets some additional compatibility by not specifying it, and saying that "GET is setfable". All this brings up an important question: what is the minimum set of Common Lisp constructs needed to implement the rest of Common Lisp? We've worked on this question, and decided it's very hard. As the above examples show, the absence of functions like PUT means that you must have SETF of GET in the Common Lisp "kernel", which means that you have to have SETF, which probably means that DEFINE-SETF-METHOD has to be in this kernel, ad infinitum... It's not easy to define *any* subsets of Common Lisp! >Pat Clancy stan shebs