String template always requiring a processor

Tagir Valeev amaembo at gmail.com
Thu Oct 27 21:06:19 UTC 2022


Hello!

Glad to hear, I fully support this decision.
A correction: this was suggested by Victor Nazarov. I only formulated the
problem but did not post the solution.

With best regards,
Tagir Valeev.

On Thu, Oct 27, 2022, 21:35 Guy Steele <guy.steele at oracle.com> wrote:

> I agree that, because one can always use the RAW processor (which simply
> passes back the string template itself), always requiring a processor
> syntactically seems like a good way to go.
>
> —Guy
>
> > On Oct 27, 2022, at 3:19 PM, Jim Laskey <james.laskey at oracle.com> wrote:
> >
> > We’ve been having a rethink after recent concerns expressed by several
> experts over the current string template design leading beginners down the
> path only to stubble over "string templates are not strings”. Our original
> view was that users would soon learn to insert the STR, but after
> consideration, having the surprise hit them at runtime is not a compelling
> selling point.
> >
> > Consequently, we are changing things up to follow Tagir’s suggestion of
> always requiring a processor; i.e., no naked StringTemplates. As a result,
> IDEs can flag the problem when editing or have inspection insert the STR
> automatically. For most users, STR would have been used anyway. So, this
> change really only affects those requiring the unprocessed string template
> (me and one or two other people). In those cases, users can use the RAW
> processor.
> >
> > Making it easier for IDEs to detect and correct will help mute the
> grumbling about naked StringTemplates not being string interpolation. As
> stated in the JEP, making Java safe and secure is the goal. This is the way.
> >
> > Cheers,
> >
> > — Jim
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-spec-observers/attachments/20221027/af7a3dcf/attachment.htm>


More information about the amber-spec-observers mailing list