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

Thorsten Seitz tseitz42 at icloud.com
Thu Oct 27 10:42:05 CDT 2016



> Am 26.10.2016 um 18:41 schrieb Chris Lattner via swift-evolution <swift-evolution at swift.org>:
> 
>> On Oct 26, 2016, at 1:11 AM, alessandro aresta <performerstone at gmail.com> wrote:
>> Ensure is more comprehensible, guard is for sure "always" been there in older languages... could it be kind of aliased somehow? I tend to confuse guard sometimes, despite many few decades of using it.
> 
> No, we don’t introduce needless aliases for keywords like this.
> 
> I haven’t seen it mentioned on this thread yet, but we did consider “ensure” back when the guard statement was being designed for Swift 2.  We specifically avoided it because “ensure” is very much in the lexicon of pre and post conditions, and we want to reserve its use if/when we ever get there.

Good point! Looking forward to that :-) 
I always liked Eiffel's handling of pre and post conditions.

-Thorsten 

> 
> -Chris
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution


More information about the swift-evolution mailing list