[swift-evolution] Proposals: (1) Forbidding custom `==` for value types, (2) `dispatch` keyword, (3) `default`-result for methods with `Self`, and (4) Poor-Mans-Existentials

Austin Zheng austinzheng at gmail.com
Mon Jul 18 16:35:51 CDT 2016


The compiler "will to the forwarding" because the implementation calls the
built-in function, not because there is some special case logic in the
compiler to treat that type differently from other types.

On Mon, Jul 18, 2016 at 2:33 PM, L. Mihalkovic <laurent.mihalkovic at gmail.com
> wrote:

>
>
> Regards
> (From mobile)
>
> On Jul 18, 2016, at 9:43 PM, Austin Zheng via swift-evolution <
> swift-evolution at swift.org> wrote:
>
>
> On Mon, Jul 18, 2016 at 12:28 PM, Johannes Neubauer via swift-evolution <
> swift-evolution at swift.org> wrote:
>
>> Dear Xiaodi,
>>
>> > Am 18.07.2016 um 20:55 schrieb Xiaodi Wu <xiaodi.wu at gmail.com>:
>> >
>> > As mentioned earlier, NaN != NaN, demonstrating that an Equatable
>> instance that does not always equal itself is not "radical." Plainly, your
>> proposal is unworkable.
>>
>> 1. this is a basic internal type, so it can have a special behavior,
>> since it is a well-designed data type created by the language designers
>> (since there is no need to bootstrap swift from the first bits this is OK).
>>
>
> The problem is that this is *exactly* how Swift works. There is nothing
> special about e.g. Double except for the fact that it wraps a built-in type
> and the implementation of its operations forward to built-in functions.
> This is how all the stdlib types work. You can build your own refcounted
> COW `Array` with exactly no additional compiler support from scratch, if
> you want.
>
>
> Well, there is something special.. The fact that the compiler will to the
> forwarding, and not not do something equivalent for other data types.
>
>
>
>
>
>
>
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160718/e816bd14/attachment.html>


More information about the swift-evolution mailing list