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

/prog/,

Name: why doesn't 2007-12-16 1:09

this damn thing work?

(defmacro dosquare (filled (var1 count1) (var2 count2) &body body)
  (if filled
      `(dotimes (,var1 ,count1)
         (dotimes (,var2 ,count2)
           ,@body))
      `(progn
         (dotimes (,var1 ,count1)
           (let ((,var2 0))
             ,@body)
           (let ((,var2 ,(1- count2)))
             ,@body))
         (dotimes (,var2 ,count2)
           (let ((,var1 0))
             ,@body)
           (let ((,var1 ,(1- count1)))
             ,@body)))))

Name: Anonymous 2007-12-16 10:56

(defmacro dosquare ((&rest variable-count-pairs) &body body)
 `(apply-cartesian-product (mapcar #'second variable-count-pairs) #'(lambda (,@(mapcar #'first variable-count-pairs)) ,@body)))



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