>>>>> "GvR" == Guido van Rossum <guido@beopen.com> writes: >> I would also like to volunteer to repeat the "simultaneous loop" >> syntax experiment with list comprehensions, i.e. see whether >> what's being proposed lines up with people's pre-existing >> intuitions. GvR> Please do! GvR> Though I have no doubt of the outcome: GvR> [x+y for x in [10, 20, 30] for y in [1, 2, 3]] GvR> will be almost universally understood to mean GvR> [11, 12, 13, 21, 22, 23, 31, 32, 33]. For reference, here is the what Haskell does with the same definition. Prelude> [ x+y | x <- [10, 20, 30], y <- [1, 2, 3]] [11,12,13,21,22,23,31,32,33] Jeremy PS I still find the Haskell more readable because it has some simple syntax that identifies what role each part of the expression plays. The producer is to the left of the vertical bar and each generator is identified by a "<-".
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4