Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

ACONDTIMES

Name: Anonymous 2010-10-01 20:40

How do you like my new macro?

(defmacro acondtimes ((var count) test &body then)
  (if (plusp count)
      (let ((sym (gensym)))
        `(let* ((,var ,count)
                (,sym ,test))
           (if ,sym
               (let ((it ,sym)) ,@then)
               (acondtimes (,var ,(1- count)) ,test ,@then))))
      nil))


Hardly tested; rude bug reports expected.

Name: Anonymous 2010-10-01 21:40

>>3
scratch 1. I get it now. You want to do
(acondtimes (var 3) (=2p var) `(success on ,var with ,it))
or whatever, and have that work "as expected"

I'm afraid I don't see the use for it in general programming.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List