What can you do in LISP that you can't do in Python

Roger Corman roger.corman at ehealthinsurance.com
Fri May 25 13:32:57 EDT 2001


"mikel evins" <himself at mikelevins.com> wrote in message news:<9ej797$cff at dispatch.concentric.net>...
> "mikel evins" <himself at mikelevins.com> wrote in message
> news:9ej713$416 at dispatch.concentric.net...
> 
> > I checked the compiled code in Corman Lisp, Lispworks, ACL 6.0, and MCL
>  3.9.
> > Apparently all the compiler writers are under the same mistaken impression
>  I
> > am. Should we file bug reports? :-)
> 
> Paul's right; it returns the number of times counting-setq got called before
> the current macroexpansion. See how silly I am?


Here is a corrected version:

(let* ((count 0)
       (incrementer #'(lambda () (setq count (1+ count)))))
  (defmacro counting-setq (var val)
    `(prog1
       (funcall ,incrementer)
       (setq ,var ,val))))

This is not affected by when the macro gets expanded, just by the
run time count.

Roger



More information about the Python-list mailing list