for each loop with condition

Jeff Watkins jeff at metrocat.org
Sat Oct 10 16:59:52 PDT 2009


That's more compact, but is it worth adding keywords (where) and  
complexity when you can easily write:

for each (book in books)
{
     if (100>book.pages)
         continue;
     do();
}

On 10 Oct, 2009, at 9:41 AM, memolus at googlemail.com wrote:

> Compare:
>
>
> for each(book in books where book.pages > 100) { do(); }
>
>
> for each(book in books) {
>  if(book.pages > 100) { do(); }
> }
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss




More information about the es-discuss mailing list