[swift-evolution] Revisiting SE-0041 Names
Dave Abrahams
dabrahams at apple.com
Tue Jun 28 12:26:50 CDT 2016
on Tue Jun 28 2016, Erica Sadun <erica-AT-ericasadun.com> wrote:
>> On Jun 27, 2016, at 8:46 PM, Dave Abrahams <dabrahams at apple.com> wrote:
>>
>>
>> on Mon Jun 27 2016, Erica Sadun <erica-AT-ericasadun.com> wrote:
>>
>
>>>> On Jun 27, 2016, at 4:47 PM, Dave Abrahams via swift-evolution <swift-evolution at swift.org> wrote:
>>>>
>>>>> Maybe we could say that the type gives form to the literal or embodies
>>>>> the literal? Thus maybe a name like `IntegerLiteralEmbodiment` or
>>>>> `IntegerLiteralManifestation`, maybe even `IntegerLiteralModeling`.
>>>
>>>>
>>>> The first two names are so esoteric that I can't imagine them being anything but
>>>> confusing, and “Modeling” is redundant; everything that conforms to a
>>>> protocol models that protocol.
>>>>
>>>> If we were to add words to the name, I'd go with
>>>>
>>>> IntegerLiteralExpressible
>>>>
>>>> I *think* I still would want to sink this name into the Syntax
>>>> namespace, though.
>>>
>>> You didn't respond to my earlier suggestion so I'd like to pitch it again.
>>>
>>> What about "Syntax.IntegerLiteralConsumer", which suggests that
>>> conforming types can consume integer literal syntax as native to their
>>> type.
>>
>> To me, the idea of a type (other than, say, a parser) consuming syntax
>> is pretty alien. So this one is sorta esoteric too, IMO.
>>
>> --
>> Dave
>
> It may be sorta esoteric, but I'd say it's a fair degree clearer to the intended
> audience of Swift developers.
>
> I ran a one-question poll last night about "Syntax.IntegerLiteralExpressible".
> I asked what Swift developers (who were not following this discussion) thought it
> meant.
>
> The results can be found here:
> https://www.surveymonkey.com/results/SM-FGMC93JT/ <https://www.surveymonkey.com/results/SM-FGMC93JT/>
> A tab at the top lets you view individual answers paired with explanations.
>
> By a margin of at least like 9:1 (more if you include the freeform answers of "why" such as
> answer 80, which says "It reminds me of StringLiteralExpressible which behaves that way.
> But you're right, the name sounds like the other option.") developers thought that the
> protocol meant (or should mean) that the conforming type could express itself as an integer
> literal, and not that an integer literal can be expressed as the
> conforming type.
Which is exactly the right sense. Well, the only correct-ish option you
gave people is slightly awkward and inaccurate—I'd have said “Instances
of the conforming type can be expressed as integer literals,” but that
matches the 90% meaning almost exactly; certainly much better than the
10%.
As far as I can tell, your poll supports my suggestion.
> I encourage you to look at the individual responses. They include the
> freeform answers that describe why each person chose as they did.
--
Dave
More information about the swift-evolution
mailing list