Hi Daniel,
I too like the iter macro so much that I've written my own version for
clojure (http://github.com/hoeck/clojurebox2d/blob/master/hoeck/
iterate.clj :).
I use it to make it easier to work with the JBox2D physics engine,
which is a a Java port from Box2D (written in C++) and thus often
On Nov 6, 12:51 pm, Daniel Janus wrote:
> As another example, consider multiplying the first 42 elements of a
> list of numbers by 42, and leaving the rest unchanged. It's much more
> straightforward for me to write (and then read)
>
> (iter (for x in lst)
> (for i from 0)
> (collect (
On 6 Lis, 02:02, John Harrop wrote:
> On Thu, Nov 5, 2009 at 7:03 PM, Daniel Janus wrote:
> > To avoid citing the entire README blurb, I'll just give you some
> > examples:
>
> > (iter (for x in [31 41 59 26])
> > (for y from 1)
> > (collect (+ x y)))
> > ==> (32 43 62 30
On Thu, Nov 5, 2009 at 7:03 PM, Daniel Janus wrote:
> To avoid citing the entire README blurb, I'll just give you some
> examples:
>
>(iter (for x in [31 41 59 26])
> (for y from 1)
> (collect (+ x y)))
>==> (32 43 62 30)
>
>(iter (for s on [1 2 3 4 5])
>(for
What's wrong with (map + [31 41 59 26] (iterate inc 1)) ?
(use 'clojure.contrib.seq-utils)
(defn sliding-window [coll size]
(let [idx (into {} (indexed coll))]
(map #(vals (select-keys idx (range (- % size) (+ % size 1
(range (count coll)
This is the same as your second
On 2009-11-05, at 7:03 PM, Daniel Janus wrote:
>
> Dear all,
>
> I am happy to announce the public availability of clj-iter, an
> Iterate-
> like iteration macro. It is free (available under the terms of MIT
> license) and can be found on GitHub: http://github.com/nathell/clj-
> iter
>
> The
Dear all,
I am happy to announce the public availability of clj-iter, an Iterate-
like iteration macro. It is free (available under the terms of MIT
license) and can be found on GitHub: http://github.com/nathell/clj-iter
The design goal was to keep it as simple as possible, and make it
blend wel