Car and cdr (Re: Python syntax in Lisp and Scheme)

Pascal Bourguignon spam at thalassa.informatimago.com
Mon Oct 13 10:29:50 EDT 2003


Pascal Costanza <costanza at web.de> writes:
> Stephen Horne wrote:
> > On Mon, 13 Oct 2003 15:28:57 +1300, "Greg Ewing (using
> > news.cis.dfn.de)" <g2h5dqi002 at sneakemail.com> wrote:
> > 
> >>Andrew Dalke wrote:
> >>From that point of view, "car" and "cdr" are as good
> >>as anything!
> > "left" and "right" - referring to 'subtrees'?
> 
> Sure, why not?
> 
> (defun left (tree)
>    (car tree))
> 
> (defun right (tree)
>    (cdr tree))
>
> ;-)
 
Wrong:

    (defun left  (tree)  (car (car tree)))
    (defun right (tree)  (cdr (car tree)))
    (defun label (tree)  (cdr tree))
 
 
> Note: Why break anyone else's code just because you prefer a different
> vocabulary?
> 
> (Yes, this is different from the Python mindset. What I have learnt
> from this thread is that the languages might seem similar on the
> technical level, but the "social" goals of the languages are vastly
> different.)

-- 
__Pascal_Bourguignon__
http://www.informatimago.com/
Do not adjust your mind, there is a fault in reality.




More information about the Python-list mailing list