chicken-users
[Top][All Lists]

## Re: [Chicken-users] Problems with srfi-4-comprehensions

 From: Ivan Raikov Subject: Re: [Chicken-users] Problems with srfi-4-comprehensions Date: Fri, 23 Mar 2007 12:29:33 -0400 (EDT)

```Hi Alex,

Thanks for adding these extensions to loopy-loop. I still haven't looked
at it, as I am still fighting with SRFI-42, but you have certainly made
the case for at least considering loopy-loop. And actually, I have a
question: I want to have an iterator that lets me create several vectors
of the same length simultaneously, something along the lines of (in

(values-ec (vector-ec <qualifiers> (expr ... (values expr ...)))

Basically, the idea is that the expression evaluated at each step in the
iterator returns multiple values { v_1 .. v_N } and each value v_i becomes
a component in  a set of vectors V of cardinality N. At any given
iteration j, the following holds:

V_i[j] = v_i, i = 1 .. N

Do you suppose that's possible in loopy-loop and how would you do it?

-Ivan

--
Ivan Raikov
337466 Georgia Tech Station, Atlanta, GA 30332-1750

On Thu, 22 Mar 2007, Alex Shinn wrote:

> For those of you currently using srfi-42 or CL's loop or otherwise
> hesistant to try loopy-loop, let me point out some advantages of
> loopy-loop:
>
> 1) It's simpler and easier to use.  It really is.  If the documentation
>    doesn't reflect this well, tell me so I can improve it :)
> 2) It's more general.  It gracefully handles changes as your loop grows
>    in complexity and accumulates ad-hoc special cases.
> 3) It's fast.  It produces very simple, tight code with no mutations.
>    All the alternatives use mutation.
> 4) It's compile-time only.  There are no run-time dependencies, making
>    it suitable even if you don't want to use any module system.
> 5) It's actively developed and tested to work with either syntax-case or
>    syntactic-closures, whichever you prefer.  The latter is smaller and
>    faster.
> 6) It preserves line number debugging information when used with
>    syntactic-closures.
> 7) It allows implicit destructuring-bind on all loop variables.
> 8) It has lots of nifty iterators (e.g. hash-tables, permutations and