On Tue, Mar 15, 2005 at 02:47:33AM -0600, Rod Adams wrote:
: I'm trying to define zip(), but can't come up with a signature for a
: function that returns a lazy list of lvalues, but the list itself is not
: lazy?
If we go with my once-upon-a-time notion of using zip(@a;@b), then it
naturally comes in as [EMAIL PROTECTED],[EMAIL PROTECTED]
: As a second matter, can you declare a type for the elements of a slurpy
: array?
Yes, and it distributes as any array return type declaration would.
: So far I have:
:
: multi sub zip (Array [EMAIL PROTECTED]) returns List {
: gather {
: while any(@lists) {
any() is not guaranteed to produce left-to-right order.
: for @lists -> @list {
: take shift @list;
: }
: }
: }
: }
:
: But I can't tackle the lvalue problem.
Why do they need to be lvalues? I always thought of zip as non-destructive.
Has zip historically been destructive in other languages?
: btw, I'm defining the semantics of some of several functions by simply
: supplying a reference implementation.
That's cool.
Larry