McCarthy's eval correction?

Liste des GroupesRevenir à cl lisp 
Sujet : McCarthy's eval correction?
De : dan.list (at) *nospam* lispclub.com (Daniel Cerqueira)
Groupes : comp.lang.lisp
Date : 17. Apr 2025, 11:37:09
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <87bjsv3wh6.fsf@lispclub.com>
User-Agent : Gnus/5.13 (Gnus v5.13)
Pièces jointes : signature.asc (application/pgp-signature)
In trying to understand McCarthy's eval, I have one question left
unresolved.  Let me give a code snippet of eval, which is written in
Common Lisp, taken from Paul Graham's draft.

```
(defun eval. (e a)
  (cond
    ...
    ((eq (caar e) 'label)
     (eval. (cons (caddar e) (cdr e))
            (cons (list (cadar e) (car e)) a)))
    ...
    ))
```

I wonder what practical difference does it make to, instead, write eval
like this:

```
(defun eval. (e a)
  (cond
    ...
    ((eq (caar e) 'label)
     (eval. (cons (caddar e) (cdr e))
            (cons (list (cadar e) (caddar e)) a)))
    ...
    ))
```

Anyone?

In my opinion, it makes no practical difference, and this correction
avoids unnecessary double processing.

--
The pioneers of a warless world are the youth that
refuse military service. ~ Albert Einstein


Date Sujet#  Auteur
17 Apr 25 o McCarthy's eval correction?1Daniel Cerqueira

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal