[swift-evolution] Revisiting SE-0041 Names

Xiaodi Wu xiaodi.wu at gmail.com
Thu Jun 23 05:22:55 CDT 2016


On Thu, Jun 23, 2016 at 4:34 AM, Dmitri Gribenko <gribozavr at gmail.com>
wrote:

> On Thu, Jun 23, 2016 at 2:00 AM, Xiaodi Wu <xiaodi.wu at gmail.com> wrote:
> > On Thu, Jun 23, 2016 at 1:26 AM, David Sweeris via swift-evolution
> > <swift-evolution at swift.org> wrote:
> >>
> >>
> >> > On Jun 22, 2016, at 19:35, Dmitri Gribenko <gribozavr at gmail.com>
> wrote:
> >> >
> >> >> On Wed, Jun 22, 2016 at 5:15 PM, David Sweeris <davesweeris at mac.com>
> >> >> wrote:
> >> >> That's a really interesting idea. Is "Syntax" a placeholder, or is
> that
> >> >> the intended name?
> >> >
> >> > It is the best name we could come up with, we are open to better
> >> > suggestions.
> >>
> >> I guess it depends on the intended semantics of the "namespace". If the
> >> purpose is to be a container for the various LiteralConvertible
> protocols,
> >> then maybe something like `AcceptsLiteralType.Integer` might be better?
> It's
> >> a bit wordy, though.
> >
> >
> > I get what's being aimed at here, but I think the meaning of `Syntax` in
> > this context is indecipherable. IIUC, the point to be conveyed by the
> term
> > is that a literal has no type until it is supplied as an argument to the
> > initializer and becomes typed.
>
> The point of using "Syntax" is to emphasize that this protocol is for
> integration with the language syntax.  The "Syntax" pseudo-namespace
> groups protocols that provide a special kind of a capability --
> changing the meaning of builtin language syntax.  This protocol is not
> meant to be coded against, used in other APIs or handled by the code
> in any other way except by being adopted (except maybe in the standard
> library code itself).
>

This makes a lot of sense now after your expanded explanation. I still
think, though, that the name reads rather absurdly. Most charitably, your
types would conform to "integer literal syntax," whatever that means.
Visually, it looks like your types "conform to Syntax." Could I suggest
maybe `SyntacticIntegration` or `SyntaxIntegrating`? Something along those
lines.

Should we add any other compiler interfaces that affect how builtin
> syntax works, they would also go into the "Syntax" namespace.
>
> Dmitri
>
> --
> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160623/9d5c13be/attachment.html>


More information about the swift-evolution mailing list