Revisit the String template syntax

Attila Kelemen attila.kelemen85 at gmail.com
Tue Apr 11 18:59:00 UTC 2023


I would certainly not change it:

1. This leaves the non-prefixed possibility as an option.
2. That would be a waste, because now you have to escape "$".
3. This would make some syntax difference between the two versions of
quotes, making conversion error prone.
4. Even though a lot of languages employ the "$" way, the "\{...}"
makes more sense conceptually, since you are kinda escaping an
expression.

Remi Forax <forax at univ-mlv.fr> ezt írta (időpont: 2023. ápr. 11., K, 20:32):
>
> I've promoted this email to amber-spec-experts given that several people on the internet and offline have said more or less the same thing.
>
> Even if it's not for 21, now that a string template is always prefixed by a template processor, the part in between quote does not need to rely on backslash '\' anymore.
>
> Should we still keep the current syntax \{...} or should we go to the more usual ${...} syntax ?
>
> regards,
> Rémi
>
> ----- Original Message -----
> > From: "Octavia Togami" <octavia.togami at gmail.com>
> > To: "amber-spec-comments" <amber-spec-comments at openjdk.org>
> > Sent: Tuesday, April 11, 2023 1:39:20 AM
> > Subject: Syntax question for JEP 430: String Templates
>
> > Hi,
> >
> > I was reading this portion of the alternatives section:
> >
> >> For the syntax of embedded expressions we considered using ${...}, but that
> >> would require a tag on string templates (either a prefix or a delimiter other
> >> than ") to avoid conflicts with legacy code.
> >
> > And it seems that this is no longer a valid reason, as per [1] there
> > is always a required prefix anyways. Is there another reason to avoid
> > using this syntax now?
> >
> > Thanks,
> > Octavia
> >
> > [1]:
> > https://mail.openjdk.org/pipermail/amber-spec-experts/2022-October/003631.html


More information about the amber-spec-observers mailing list