Re: [swift-evolution] Proposal to change Logical NOT Operator from exclamation mark ( ! ) to something else

2017-02-15 Thread Chris Lattner via swift-evolution
On Feb 15, 2017, at 6:02 AM, Sadiq via swift-evolution wrote: > I would like to suggest to change Logical NOT Operator from ! to something > else. > It will increase the readability of the code and will avoid any confusion > with the symbol used for force unwrapping

Re: [swift-evolution] Proposal to change Logical NOT Operator from exclamation mark ( ! ) to something else

2017-02-15 Thread Haravikk via swift-evolution
> On 15 Feb 2017, at 22:44, Nicolas Fezans via swift-evolution > wrote: > > > 3: maybe ~ is a better fit? > > just for information this is in line with Matlab in which the following three > "not"-related syntax exist: > a) ~ as a prefix operator for not > b) not as

Re: [swift-evolution] Proposal to change Logical NOT Operator from exclamation mark ( ! ) to something else

2017-02-15 Thread Nicolas Fezans via swift-evolution
> 3: maybe ~ is a better fit? just for information this is in line with Matlab in which the following three "not"-related syntax exist: a) ~ as a prefix operator for not b) not as a function c) ~= as an infix operator for "is not equal to" I see pros and cons for each option and have a very

Re: [swift-evolution] Proposal to change Logical NOT Operator from exclamation mark ( ! ) to something else

2017-02-15 Thread André “Zephyz” Videla via swift-evolution
As of today, this is possible: prefix operator ¬ prefix func ¬ (value: Bool) -> Bool { return !value } let t = true let f = ¬t I have to admit that I quite like this but it has a couple drawbacks: 1: if you've never seen the ¬ operator in math it makes no more sense than "!" 2: It's quite

Re: [swift-evolution] Proposal to change Logical NOT Operator from exclamation mark ( ! ) to something else

2017-02-15 Thread Derrick Ho via swift-evolution
There is no need to change it Since the context basically disambiguates the meaning of ! The next best thing is to compare it to false (val == false) // same as !val On Wed, Feb 15, 2017 at 3:02 PM David Waite via swift-evolution < swift-evolution@swift.org> wrote: > If someone came with a

Re: [swift-evolution] Proposal to change Logical NOT Operator from exclamation mark ( ! ) to something else

2017-02-15 Thread David Waite via swift-evolution
If someone came with a nice syntax I’d be for this. I can’t imagine what that would be. I doubt there is an alternate prefix or postfix operator that would pass muster, due to ‘!’ already meaning the appropriate thing in so many languages, and swift only supporting symbolic operators. I can’t

Re: [swift-evolution] Proposal to change Logical NOT Operator from exclamation mark ( ! ) to something else

2017-02-15 Thread Sadiq via swift-evolution
If that's the case, force unwrapping can be done with a different symbol. Personally I like '!' for force unwrapping. On Wed, Feb 15, 2017 at 11:45 PM, Jose Cheyo Jimenez wrote: > https://lists.swift.org/pipermail/swift-evolution/ > 2015-December/32.html > > Swift tries

Re: [swift-evolution] Proposal to change Logical NOT Operator from exclamation mark ( ! ) to something else

2017-02-15 Thread Robert Widmann via swift-evolution
So you've identified the problem, but what do you propose as a solution here? It should be noted that a (non-stdlib) language-level answer to this question has already been discussed and rejected (https://lists.swift.org/pipermail/swift-evolution/2015-December/32.html). ~Robert Widmann

[swift-evolution] Proposal to change Logical NOT Operator from exclamation mark ( ! ) to something else

2017-02-15 Thread Sadiq via swift-evolution
Hello, I would like to suggest to change Logical NOT Operator from ! to something else. It will increase the readability of the code and will avoid any confusion with the symbol used for force unwrapping of optional values. It would be easier for new programmers to learn Swift as the first