forany, forall...

2005-01-16 Thread Jonathan Lang
How would I do the following in Perl 6? if a given condition is true for every element in a list, do something. or if a given condition is true for any element in a list, do something. = Jonathan "Dataweaver" Lang __ Do you Yahoo!? Ya

Re: forany, forall...

2005-01-16 Thread Brent 'Dax' Royal-Gordon
Both of your questions are quite elegantly handled by junctions. If the condition were, say, $elem > 10: Jonathan Lang <[EMAIL PROTECTED]> wrote: > if a given condition is true for every element in a list, do something. if all(@list) > 10 { ... } > if a given condition is true for any e

Re: forany, forall...

2005-01-16 Thread Jonathan Scott Duff
On Sun, Jan 16, 2005 at 09:27:56PM -0800, Jonathan Lang wrote: > How would I do the following in Perl 6? Modulo any syntax foibles, I think it'd look like this: > > if a given condition is true for every element in a list, do something. if all(LIST) > 3 { do_something } > > or > > if a g