Re: clj-iter, an iteration macro for Clojure inspired by Common Lisp's Iterate

2009-11-06 Thread hoeck
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

Re: clj-iter, an iteration macro for Clojure inspired by Common Lisp's Iterate

2009-11-05 Thread Timothy Pratley
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 (

Re: clj-iter, an iteration macro for Clojure inspired by Common Lisp's Iterate

2009-11-05 Thread Daniel Janus
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

Re: [ANN] clj-iter, an iteration macro for Clojure inspired by Common Lisp's Iterate

2009-11-05 Thread John Harrop
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

Re: clj-iter, an iteration macro for Clojure inspired by Common Lisp's Iterate

2009-11-05 Thread kyle smith
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

Re: [ANN] clj-iter, an iteration macro for Clojure inspired by Common Lisp's Iterate

2009-11-05 Thread Stefan Arentz
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

[ANN] clj-iter, an iteration macro for Clojure inspired by Common Lisp's Iterate

2009-11-05 Thread Daniel Janus
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