Re:Kotlin: A Language with a Bright Future
by vram22 on Wednesday November 22, 2017 @12:07PM
(#15758388)
Hadn't thought of it that way myself, I may have just thought that the way (order) it works is the same as the way it is actually designed to work, and then later looking at the docs confirmed that, but yes, yours is a valid point of view.
Yeah, I think that was a huge mistake, because the most common case is one-level and if you have one level the syntax is just the reverse of a regular for, but in a two-level comprehension (the rare case) you have to remember that it's not a reversal, it's a cyclic permutation.
i.e. most of the examples you see look like this, and these two are equivalent:
and then occasionally you see a comprehension that looks like: so you'd expect this to be equivalent to but it isn't, it's equivalent to which is really hard to remember.