eviate this problem woud make “3” + “4” a type
error (since strings are not a commutative monoid)
> On 1 Sep 2017, at 03:27, John McCall <rjmcc...@apple.com> wrote:
>
>>> On Aug 31, 2017, at 8:51 PM, André “Zephyz” Videla via swift-evolution
>>> <swift-evoluti
> But given the scope capturing nature of closures I was actually wondering if
> this 'purity' should be applied to closures.
I think It should, pure closure cannot have outside references and therefore
cannot create reference cycles even though they are escaping.
I tend toward using the =>
+1
I think it's a very interesting proposal and here is why:
- It improve readability by expressing intent.
For example the difference between those two function, just by their signature,
is obvious:
func update(_ m: Class) -> Class
and
func update(_ m: Class) => Class
The first one mutates
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
Ah I see you point a bit better.
But I don't agree with your example, since it can be easily expressed with
test?.prefix(while: { $0 != 42}).forEach { i in
print(i)
}
But arguing about examples is besides the point, I would like to stop here.
I have a question for you. How do you think we