[swift-evolution] [pitch] rename 'guard' to 'ensure'

Chris Lattner clattner at apple.com
Tue Oct 25 19:52:56 CDT 2016


> On Oct 25, 2016, at 10:20 AM, Joe Groff via swift-evolution <swift-evolution at swift.org> wrote:
> 
> At this point in Swift's evolution, source-breaking changes to the language require strong motivation. We can't really entertain superficial keyword changes like this without overwhelming evidence that the existing syntax is problematic in practice. `guard` has precedent in functional languages, for instance in Haskell where the `guard` function is idiomatically used as part of monadic `do`-notation computations, and has the same positive condition semantics in those languages.

Right.  Jay, I’m sorry if you or others find the name “guard” to be confusing, but there are many Swift developers that like it.  I is almost inconceivable that we would change it at this point.

-Chris


More information about the swift-evolution mailing list