
wmfarr.blogspot.com
SchemingProgramming notes and ideas from an astrophysicist. Loop-Unrolling Macros in Clojure. I've been fooling around with clojure. A bit lately. Something fun: a. Like macro, but it completely unrolls your loop at compile time:. Defmacro dotimes-unroll "Just like dotimes, but completely unrolls the given loop. The number of iterations must read as a number." [ i n] and body] (assert (number? N) (if (= n 0) `nil `(let [ i (- n 1)] (dotimes-unroll [ i (- n 1)] @body) @body) ). Links to this post. 1 when r = a/b,...
http://wmfarr.blogspot.com/