Fun as this conversation is, replacing "!" with "not" and other related
changes ("&&" replaced with "and", etc.) represent a commonly proposed and
rejected change
<https://github.com/apple/swift-evolution/blob/master/commonly_proposed.md>,
and the rationale is given here
<https://lists.swift.org/pipermail/swift-evolution/2015-December/000032.html>
.On Sun, May 22, 2016 at 1:15 PM, Dave Abrahams via swift-evolution < [email protected]> wrote: > > on Sat May 21 2016, Антон Миронов <[email protected]> wrote: > > > I found negation operator (!) the least detectable among the code. So > > I’ve decided to add property “not” to BooleanType (Swift 2.2) or > > Boolean on 3.0 with extension: > > > > extension BooleanType { > > var not: Bool { return !self.boolValue } > > } > > > > This is code with negation operator: > > return !self.lanes[position.y][currentLaneRange].contains(.Gap) > > > > As I sad before negation operation is hard to spot. Moreover at first > > it looks like I’m trying to negate self for some reason. > > > > This is code with “not” property: > > return self.lanes[position.y][currentLaneRange].contains(.Gap).not > > I think having the “not” up at the front of the boolean condition is > useful. Think about why this joke works: > > “I'm a big fan of reference semantics... NOT!” > > -- > -Dave > > _______________________________________________ > swift-evolution mailing list > [email protected] > https://lists.swift.org/mailman/listinfo/swift-evolution >
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
