Re: [swift-evolution] Equatable auto-write func == Proposal

2016-09-26 Thread Martin Waitz via swift-evolution
Hi, Am 2016-09-26 12:53, schrieb Francisco Costa via swift-evolution: +1 for making enums with payloads Equatable by default. Right now this requires lots of copy-paste boiler plate that can easily result in bugs. Of course, making structs and enums Equatable should be much easier (the same

Re: [swift-evolution] Equatable auto-write func == Proposal

2016-09-26 Thread Francisco Costa via swift-evolution
+1 for making enums with payloads Equatable by default. Right now this requires lots of copy-paste boiler plate that can easily result in bugs. As for the general struct case, I think there could be a default implementation but we should be able to overwrite `==` if we need to. Doesn't seem

[swift-evolution] Equatable auto-write func == Proposal

2016-09-19 Thread Jérôme Duquennoy via swift-evolution
Hi guys, It would be awesome if with this evolution, we could also auto-write equality operators for enum with equatable payloads. Today, considering this enum enum SimpleEnum { case case1 case case2 } the condition SimpleEnum.case1 == SimpleEnum.case1 compiles and return true. But if

Re: [swift-evolution] Equatable auto-write func == Proposal

2016-09-13 Thread Chris Lattner via swift-evolution
> On Sep 13, 2016, at 2:11 PM, Mark Sands via swift-evolution > wrote: > > I'm very interested in this moving forward. Is the swift team still holding > off on reviewing additive changes? Yep, we’re still focused on finishing Swift 3 and moving on to Swift 4 stage

Re: [swift-evolution] Equatable auto-write func == Proposal

2016-09-13 Thread Mark Sands via swift-evolution
I'm very interested in this moving forward. Is the swift team still holding off on reviewing additive changes? On Mon, Sep 12, 2016 at 10:43 AM, Tony Allevato via swift-evolution < swift-evolution@swift.org> wrote: > I started on an early-draft proposal for something like this a while back: >

Re: [swift-evolution] Equatable auto-write func == Proposal

2016-09-12 Thread Daniel Tartaglia via swift-evolution
Good point. The real push here is that when the programmer *does* declare a type Equatable and the op == has an obvious implementation, that the programmer shouldn’t have to manually implement it him/herself. This would apply only to types that have been declared Equatable and that consist of

Re: [swift-evolution] Equatable auto-write func == Proposal

2016-09-12 Thread Robert Widmann via swift-evolution
Please be careful when wording this proposal. You want derived conformances, but don't obscure that message with the claim that every type admits a useful Equatable instance. It is most certainly not the case that every value type has a useful (read [mostly]: decidable) equality. A few

Re: [swift-evolution] Equatable auto-write func == Proposal

2016-09-12 Thread Tony Allevato via swift-evolution
I started on an early-draft proposal for something like this a while back: https://gist.github.com/allevato/2fd10290bfa84accfbe977d8ac07daad Most of the discussion in the e-mail thread (I don't have time to fetch the link right now, unfortunately) was around how implicit/explicit such behavior

[swift-evolution] Equatable auto-write func == Proposal

2016-09-12 Thread Daniel Tartaglia via swift-evolution
Now that Swift 3 is out the door, I’m going to float this proposal again… Given that every value type should be equatable (rational here): https://www.andrewcbancroft.com/2015/07/01/every-swift-value-type-should-be-equatable/ And that many, if not most, value types consist of properties that are