A monkey (Peter Seibel <
pe...@gigamonkeys.com>) wrote:
> > But yuck, what's with all the gensyms?!?! The whole point of lifting
> > the body of the code is to insulate it from the LOOP's lexical
> > environment:
> >
> > (defmacro dolist-by-cddr ((var list &optional retform) &body body)
> > `(let ((body (lambda (,var) ,@body))
> > (retval (lambda (,var) ,@retform))
> > (list ,list))
> > (loop for elt in list by #'cddr
> > do (body elt)
> > finally (return (retval nil)))))
>
> Uh, don't you need some FUNCALLs? This isn't c.l.s you know.
(define (for-each-cddr func the-list)
(match the-list
[`(,a ,b . ,z) (func a) (for-each-cddr func z)]
[`(,a) (func a)]
[_ #f]))
(for-each-cddr println '(0 b 4 c 8 j 9))
0
4
8
9
--
[I]n Norway ... a straight white man was gang raped by Somali immigrants ...,
and now that one of the immigrants' prison term is ending he is opposing his
deportation.
www.renseradioarchives.com/dduke/