[swift-evolution] Proposal: Python's list, generator, and dictionary comprehensions

Adrian Kashivskyy adrian.kashivskyy at me.com
Thu Dec 17 14:27:53 CST 2015


Amir, your proposal contradicts "clarity over brevity" principle. As pointed by Liam all those things are fairly easy to do without any major complexity.

Pozdrawiam – Regards,
Adrian Kashivskyy

> Wiadomość napisana przez Amir Michail via swift-evolution <swift-evolution at swift.org> w dniu 17.12.2015, o godz. 17:26:
> 
> Python examples:
> 
> l = [x*x for x in range(10)] // list comprehension
> 
> l2 = [(x,y) for x in range(10) for y in range(10) if x + y < 8] // another list comprehension
> 
> g = (x*x for x in range(10)) // generator comprehension
> 
> d = {x:x*x for x in range(10)} // dictionary comprehension
> 
> 
> I think most programmers would like using these. They are concise and easy to understand.
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151217/c9d3db7d/attachment.html>


More information about the swift-evolution mailing list