JEP 430: String Templates Mandatory TemplateProcessor

Remi Forax forax at univ-mlv.fr
Sat May 13 15:06:48 UTC 2023


Hi Simon, 
This issue have re-discussed last month on amber-spec-expert 
[ https://mail.openjdk.org/pipermail/amber-spec-experts/2023-April/003820.html | https://mail.openjdk.org/pipermail/amber-spec-experts/2023-April/003820.html ] 

regards, 
Rémi 

> From: "interlink sg7" <interlink.sg7 at gmail.com>
> To: "amber-dev" <amber-dev at openjdk.org>
> Sent: Friday, May 12, 2023 12:49:36 PM
> Subject: JEP 430: String Templates Mandatory TemplateProcessor

> Hello,

> I tried out the early-access build of JDK 21 and saw that the TemplateProcessor
> seems to be mandatory now for String Templates:

> var hello = "Hello \{name}"; ==> error: processor missing from template
> expression

> The JEP says: "Thus if we forget to use a template processor such as STR, RAW,
> or FMT then a compile-time error is reported".

> I know you dread this kind of discussion, but if that is the case, would we now
> be able to reconsider ${…}?

> The original reason behind \{…} was to avoid conflicts with legacy code.

> Using ${…} would require a tag on string templates (either a prefix or a
> delimiter other than "). See Alternatives section in the JEP.

> However if the TemplateProcessor . TemplateArgument is mandatory it kinda acts
> as a tag anyway?

> Backwards compatibility is still ensured as far as I can tell.

> Note that there is a very strong backlash against the backslash (play on words
> intended) in the Java community.

> Kind regards,

> Simon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20230513/562bb219/attachment.htm>


More information about the amber-dev mailing list