develooper Front page | perl.perl6.language | Postings from April 2005

Re: for all(@foo) {...}

Thread Previous | Thread Next
Brad Bowman
April 23, 2005 23:01
Re: for all(@foo) {...}
Message ID:

> No, S03 is probably just wrong there.  Junctions are scalar values, and
> don't flatten in list context.  Maybe we need something like:
>     for =all(@foo) {...}
> to iterate the junction.

  for all(1,2,3).values { say $_; }

reads nicely and works in pugs.

Also, flattening may get messy with nested junctions.

>     for any(1,2,3) {...}
> then it would have done the "next", because 1 < 2.

Confused myself there.  Thanks.

> =none(1,2,3) should return a list of all the things that aren't 1, 2,
> or 3 in random order.  Maybe a lazy implementation will be beneficial
> at that point.  :-)

none() outside of boolean context is lazily evaluated by my brain.
My eyes glaze over and I think about something else.

 When one is not capable of true intelligence, it is good to consult with
 someone of good sense. -- Hagakure

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About