[swift-evolution] Control Flow Expressions
Joe Groff
jgroff at apple.com
Fri Dec 4 11:43:20 CST 2015
> On Dec 4, 2015, at 3:07 AM, Maxthon Chan <xcvista at me.com> wrote:
>
> I believe switch-as-an-expression can be implemented as a dictionary lookup, and if-as-an-expression is the ternary operator ?:
A dictionary lookup works in some cases, but is likely to be slower without optimizer heroics. Furthermore, you can't bind pattern variables or get exhaustiveness checking out of a dictionary.
-Joe
More information about the swift-evolution
mailing list