Explanation of macros; Haskell macros

Marco Antoniotti marcoxa at cs.nyu.edu
Tue Oct 7 12:07:55 EDT 2003


mike420 at ziplip.com wrote:

> (defmacro for(i in list &rest rest)
>   (if (eql 'in in)
>     (if (and (listp list)
>              (eql (length list) 2)
>              (eql 'range (first list)))
>       (list* 'dotimes (list i (second list)) rest)
>       (list* 'dolist (list i list) rest))
>     (error "syntax error")))
        ^^^^^^^^^^^^^^^^^^^^

CL has PROGRAM-ERROR for this cases.

Cheers
--
Marco





More information about the Python-list mailing list