From: Llew Thomas
Subject: Reduction
Date: 
Message-ID: <3777084A.DD90D04E@earthlink.net>
Would anyone happen to know a book or other resource that breaks
macros/pfunctions like defun down into pure steps( like car, cdr, etc)? Thanks.

- L. Thomas

From: Nick Levine
Subject: Re: Reduction
Date: 
Message-ID: <7l79jk$rps$1@epos.tesco.net>
Llew Thomas wrote in message <·················@earthlink.net>...
>Would anyone happen to know a book or other resource that breaks
>macros/functions like defun down into pure steps( like car, cdr, etc)?
Thanks.


The more I look at this question, the larger the answer gets. You could more
or less be asking someone to print the entire source for their interpreter /
compiler. The "pure steps" you're after are unlikely to be in Common Lisp
(and in some implementations amy not even be in lisp...)

Still, try macroexpanding a defun to get a feel for the level of complexity
in there. Eg in LWW 4.1 Personal:

CL-USER 1 > (pprint (macroexpand '(defun foo (x) (car x))))

(PROGN
  (COMPILER::TLF-NAME-BINDING (COMPILER-LET (QUOTE FOO))
                              (EVAL-WHEN (EVAL)
                                (COMPILER::RECORD-SF-EVAL
(COMPILER::COMPILER-EVAL

COMPILER:*FUNCTION-NAME*)

(COMPILER::COMPILER-EVAL

COMPILER::*FUNCTION-PARENT*)))
                              (EVAL-WHEN (COMPILE)
                                (COMPILER::RECORD-SF-COMPILE
COMPILER:*FUNCTION-NAME*

COMPILER::*FUNCTION-PARENT*))
                              (DSPEC:DEFUN-AUX 'FOO
                                               #'(LAMBDA (X)
                                                   (DECLARE (LAMBDA-NAME
FOO))
                                                   (BLOCK FOO (CAR X))))))

CL-USER 2 >

Gobbledygook, yes? And if you dig deeper, it gets worse.

- n
From: Llew Thomas
Subject: Re: Reduction
Date: 
Message-ID: <37777BAA.F421CFC7@earthlink.net>
Nick Levine wrote:
> 
> The more I look at this question, the larger the answer gets. You could more
> or less be asking someone to print the entire source for their interpreter /
> compiler.

Thanks for the answer. McCarthy had said that Lisp should always be able
to be broken down into primitives, but also said that this was nearly
unworkable due to impracticality (Lisp 1.5 Programmer's Manual, IIRC).
It seems to me someone gets a good idea, and then breaks that idea so
that it will work. :(

Thanks again,

Llew
From: Barry Margolin
Subject: Re: Reduction
Date: 
Message-ID: <OaMd3.953$KM3.233588@burlma1-snr2>
In article <·················@earthlink.net>,
Llew Thomas  <····@earthlink.net> wrote:
>Thanks for the answer. McCarthy had said that Lisp should always be able
>to be broken down into primitives, but also said that this was nearly
>unworkable due to impracticality (Lisp 1.5 Programmer's Manual, IIRC).
>It seems to me someone gets a good idea, and then breaks that idea so
>that it will work. :(

However, I think that you will find that in most Lisp implementations, at
least half the code is written in Lisp.  So if you get the source code to
any Lisp implementation (source to GCL and CMUCL are both available) you
should be able to see their implementors' breakdowns.

-- 
Barry Margolin, ······@bbnplanet.com
GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.