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:31

Things I don't like about this macro.

1. I don't see why you need to bind var at all.
2. binding it in the body (I'm a dirty Schemer who prefers =>)
3. The fact that the test is not a pure function.

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