On 3/8/2016 9:17 AM, Allan Clark wrote:
tl;dr What is support like for adding an 'as' clause to comprehension syntax? In order to allow map-then-filter, it might look like something this:
[y for x in numbers if abs(x) as y > 5]
Comprehensions abbreviate a particular pattern of collection initialization, nested for and if statements, and collection augmentation innermost, with the only binding being the loop names. They are easily translated back to the original pattern, although move than one level of nesting can challenge comprehension in the normal meaning of the work. I strongly feel that the current correspondence between conprehensions and statements should be maintained.