can you outline how extensions and protocol conformances might look
for structural types? to compare the ugliness of both approaches.
on Date: Tue, 21 Nov 2017 22:54:21 -0800 Douglas Gregor <email@example.com> wrote:
On Nov 21, 2017, at 10:48 PM, David Hart <firstname.lastname@example.org> wrote:
> On 22 Nov 2017, at 07:41, Douglas Gregor via swift-evolution < > email@example.com <mailto:firstname.lastname@example.org>> wrote:
>> I think it’s straightforward and less ugly to make structural types
allow extensions and protocol conformances.
> Can somebody explain to me what is less ugly about that? I would have
naturally thought that the language would be simpler as a whole if there
only existed nominal types and all structural types were just sugar over
See Thorsten’s response with, e.g.,
Function<Double, InoutParam<String>, Param<Int>>
which handles “inout” by adding wrappers around the parameter types (which
one would have to cope with in any user of Function), but still doesn’t
handle argument labels. To handle argument labels, we would need something
like strings as generic arguments. We’d also need to handle calling
conventions and anything else we invent for function types.