[swift-evolution] Proposal: Pattern Matching Partial Function (#111)

Charles Constant charles at charlesism.com
Fri Jan 29 04:06:16 CST 2016

I just used that example with "if" to try to make a point that it's not
always self-evident whether brevity is less clear. Maybe that was a poor
choice, because I was attempting to justify my support of Craig's proposal.
I don't agree that proposal is a case of "cleverer but not clearer." On the
contrary, it's probably easier for a beginner to parse, than a "switch" as
it stands.

> I think all of this could be solved by just having postfix "if" statements

I don't think the Swift team would go for that, since they've worked hard
to avoid overloading statements in the rest of the language. In previous
iterations of this discussion thread, we've already discussed variations
like "when" and "on" etc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160129/443cc3d6/attachment.html>

More information about the swift-evolution mailing list