On Oct 29, 2021, at 10:10 AM, Jim Laskey 
<james.las...@oracle.com<mailto:james.las...@oracle.com>> wrote:

For our early templated string prototypes, we restricted embedded expressions 
to just basic accessors and basic arithmetic. The intent was to keep things 
easy to read and to prevent side effects. Over time, we began thinking this 
restriction was unduly harsh. More precisely, we worried it that it would 
result in a complex, difficult-to-defend boundary. But we still would like 
users to not rely on side-effects.

Consequently, a new proposal for embedded expressions - we would allow any Java 
expression with the restriction that you can't use single quotes, double quotes 
or escape sequences. We opted to keep this restriction to allow tools (ex., 
syntax highlighters) to isolate embedded expressions within strings without 
requiring sophisticated parsing.

An interesting restriction. Would comments also be forbidden within such 
expressions (for the same reason)?

—Guy


Reply via email to