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

Charles Constant charles at charlesism.com
Fri Jan 29 01:37:59 CST 2016


On the more objective side of things, there is also the fact that, as the
proposal states, it's nice to have protection against this happening:

    let str: String
    switch(state) {
        case .Cold: str = "Too cold"; self.freezer.stop()
        case .Hot:  str = "Too hot"
        default:    str = "Just right"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160128/c71bde60/attachment.html>

More information about the swift-evolution mailing list