Linked lists (was Re: Typing system vs. Java

Alex Martelli aleaxit at yahoo.com
Tue Aug 7 21:39:48 CEST 2001


<phawkins at spamnotconnact.com> wrote in message
news:wky9ov6dgw.fsf at mail.connact.com...
> >>>>> "AM" == Alex Martelli <aleaxit at yahoo.com> writes:
>
> AM> def cdr(alist):
> AM>     return alist[1]
>
> Make that:
>
> return alist[1:]

Nope.  Remember, I had defined cons(a,b) as returning (a,b), and
cdr(cons(a,b))
must be b, not [b].


Alex






More information about the Python-list mailing list