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

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

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

> 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.

Brad
-- 
 When one is not capable of true intelligence, it is good to consult with
 someone of good sense. -- Hagakure http://bereft.net/hagakure/



Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About