Re: listing factors of a number

2010-03-23 Thread kotor
On Mar 23, 1:02 pm, Glen Rubin wrote: > Does anyone know of any existing libraries for clojure that has code > which is optimized to list all of the factors of any given integer? (defn factors [x] "integer -> vector[integers]" (loop [xf [] i 2] (if (> (* i i) x) (vec (sort (distinct x

Re: New reflection warning in r1381

2009-05-30 Thread kotor
around since Clojure 1.0. > > On May 28, 3:03 pm, kotor wrote: > > > After updating to r1381, the following code produces a "reflection > > warning - call to divide can't be resolved" on the last line. This > > warning did not occur at r1376 or earlier. > &

New reflection warning in r1381

2009-05-28 Thread kotor
After updating to r1381, the following code produces a "reflection warning - call to divide can't be resolved" on the last line. This warning did not occur at r1376 or earlier. (defn prime-frequency [x y] "integer integer -> real. frequency of primes in range" (let [xy (range x y)] (/ (coun

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-16 Thread kotor
I definitely support your second option; first / rest / next. In my mind, rest means "collection of remaining items" and should return a collection, and next will also do exactly what I would expect it to do. Clojure is sufficiently different from Common Lisp already that breaking the compatibilty