A Lisper asks, "Am I supposed to like Smalltalk?"

Bert Freudenberg bert at impara.de
Thu May 18 20:08:35 UTC 2006


Well, this function actually defines all of LISP, so literally, this  
is "one function to do everything". It's a kernel even smaller than  
Smalltalk's (and preceding it by decades).

- Bert -

Am 18.05.2006 um 01:48 schrieb Ron Teitelbaum:

> Andreas,
>
> Ok now it's my turn to byte.  So while I'm sitting here looking up  
> the Lisp
> 1.5 manual I'm thinking to myself I hope this joke is better then  
> mine.
> When I got there this is what I found:
>
> evalquote is defined by using two main functions, called eval and  
> apply.
> apply
> handles a function and its arguments, while eval handles forms.  
> Each of
> these functions
> also has another argument that is used as an association list for  
> storing
> the values
> of bound variables and f unction names.
> where
> apply [fn;x; a] =
> [atom[fn] - [ e q [ f n ; ~ ~ ~ ] - caar[x];
> e q [ f n ; ~ ~ ~ ] -- cdar[x];
> eq[fn; CONS] -- cons[car[x]; cadr[x]];
> e q [ f n ; ~ ~ ~ ~ ] -- atom[car[x]];
> eq[fn; EQ] - eq[car[x]; cadr[x]];
> T - apply[eval[fn;a];x;a]];
> eq[car[fn]; LAMBDA] -- eval[caddr [fn]; pairlis[cadr[fn];x;a]];
> eq[car [fn]; LABEL] - apply [caddr [fn]; x; cons [cons[cadr [fn];
> c addr [f n]]; a]]]
> eval[e;a] = [atom[e] - cdr[assoc[e;a]];
> atom[car[e]] -
> [eq[car QUOTE] - cadr [el;
> eq[car[e]; COND] - evcon[cdr [el; a];
> T -- apply[car [el; evlis[cdr [el; a]; a]];
> T - apply[car [el; evlis [cdr [el; a]; a]]
> pairlis and assoc have been previously defined.
> evcon[c; a] = [eval[caar [c]; a] -- eval[cadar [c]; a];
> T -- evcon[cdr [c];a]]
> and
> evlis[m;a] = [null[m] - NIL;
> T - cons [eval[car [m];a];evlis[cdr [m];a]]]
>
> So other then an offhanded joke about Elvis I have to admit I don't  
> get it!
>
> :^D
>
> Ron
>
>> -----Original Message-----
>> From: squeak-dev-bounces at lists.squeakfoundation.org [mailto:squeak- 
>> dev-
>> bounces at lists.squeakfoundation.org] On Behalf Of Andreas Raab
>> Sent: Wednesday, May 17, 2006 5:25 PM
>> To: The general-purpose Squeak developers list
>> Subject: Re: A Lisper asks, "Am I supposed to like Smalltalk?"
>>
>> Stéphane Rollandin wrote:
>>> Ron Teitelbaum wrote:
>>>> If you really love functions you can have one class and one  
>>>> method do
>>>> everything!  :)
>>>
>>> hmmm... that's a puzzle ?
>>>
>>> ok I give up ! what method ?
>>
>> It's right there on the bottom of page 13 of the Lisp 1.5 manual.
>>
>> Cheers,
>>    - Andreas
>>
>>
>
>
>




More information about the Squeak-dev mailing list