Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Well, if you have the concept of Maybe/Optional, it's quite handy to have a conditional binding as control flow (as in Swift):

    guard let value = myOptional else {
        // Handle absence
    }
    // Use value
Or

    if let value = myOptional {
        // Use value
    }


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: