[swift-evolution] Should we rename "class" when referring to protocol conformance?

Dave Abrahams dabrahams at apple.com
Thu May 5 17:01:42 CDT 2016


on Wed May 04 2016, David Sweeris <davesweeris-AT-mac.com> wrote:

>> On May 4, 2016, at 13:29, Dave Abrahams via swift-evolution <swift-evolution at swift.org> wrote:
>> 
>> In order for something like AnyValue to have meaning, we need to impose
>> greater order.  After thinking through many approaches over the years, I
>> have arrived at the (admittedly rather drastic) opinion that the
>> language should effectively outlaw the creation of structs and enums
>> that don't have value semantics.  (I have no problem with the idea that
>> immutable classes that want to act as values should be wrapped in a
>> struct).  The language could then do lots of things much more
>> intelligently, such as correctly generating implementations of
>> equality. 
>
> You mean that a struct's properties would have to have value
> semantics, too? 

Either that, or you'd have to implement CoW, or you'd not use the
storage behind any properties that were references in a way that affects
value semantics.

> I think I'm okay with that, especially if it's done through new types
> of structs/enums.

New types of structs/enums?  What does that mean?

-- 
Dave


More information about the swift-evolution mailing list