<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">I like this idea, but would certainly prefer it to be an expression (your alternative suggestion, array comprehension) rather than a statement. Your example of building an array of tuples [(suit, rank)] could then be achieved without having to append to a var during iteration.</div><br class=""><blockquote type="cite" class=""><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">Yes, it’d be great if you can combine it with where. Alternatively, it could be interesting to instead explore array comprehension syntax, rather than making `for` smarter. That’d allow for a more functional style. For example, Norvig’s spelling corrector (<a href="http://norvig.com/spell-correct.html" class="">http://norvig.com/spell-correct.html</a>) would then be very straightforward to port.

Re the x operator: it’s even easier if you define it with flatMap. However, the for syntax is different, because the second clause can depend on the first...

Chris</pre></blockquote><div class=""><br class=""></div></body></html>