Hi Viksit,

I would suggest that the CL loop construct and the Clojure construct
of the same name are, in fact, fairly different beasts, both
structurally and in terms of their goals. I don't believe that Rich
has any intent to extend loop towards the CL flavored loop. The for
construct is more Clojure's answer in that direction, though it is not
nearly so flexible.

No reason you couldn't build something similar to CL's loop construct
in Clojure, but Clojurians in general seem to have an aversion to its
"boil the ocean" nature.

I do think, however, that it would be nice to have some syntactic
sugar for consuming sequences in parallel in the for construct. I
can't think of a nice way to do it right now, though.

Tom

On Jun 18, 10:45 am, viksit <vik...@gmail.com> wrote:
> Hey Meikel,
>
> On Jun 17, 10:48 pm, Meikel Brandmeyer <m...@kotka.de> wrote:
>
> > Hi,
>
> > On Jun 18, 1:35 am, viksit <vik...@gmail.com> wrote:
>
> > > (loop for x in '(a b c d e)
> > >       for y in '(1 2 3 4 5)
> > >       collect (list x y) )
>
> > > ((A 1) (B 2) (C 3) (D 4) (E 5))
>
> > > Are there any good (and idiomatic) methods to achieve this using a
> > > Clojure loop construct?
>
> > user=> (map vector [:a :b :c :d :e] [1 2 3 4 5])
> > ([:a 1] [:b 2] [:c 3] [:d 4] [:e 5])
>
> Oh yes, thanks. I know about using the map method - I was just
> wondering if Clojure's loop supports (or has any plans to support) the
> loop construct as in CL (http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/
> node235.html). And if not, then are there any ways to "loop" through 2
> lists in parallel.
>
> Cheers
> Viksit
>
>
>
>
>
> > Sincerely
> > Meikel

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to