RFR: JDK-8198986 - 3.10.7: Raw string literals

John Rose john.r.rose at oracle.com
Wed Mar 7 21:41:45 UTC 2018

On Mar 7, 2018, at 11:27 AM, Jim Laskey <james.laskey at oracle.com> wrote:
> JEP 326: Raw String Literals JDK-8196004 <https://bugs.openjdk.java.net/browse/JDK-8196004> has been approved as a JEP Candidate. I would like to propose this JEP to target sometime soon. Of course, there are many steps to getting there, including the review of the Java™ Language Specification.
> Please find a draft of the required  Java™ Language Specification changes at JDK-8198986 <https://bugs.openjdk.java.net/browse/JDK-8198986> for your review.

Looks good!  Glad to see the clarifying examples
about backtick count (Bob and Jim's adventures).

One problem in the examples:

Hello, world
````````````    // the twelve characters H e l l o , SP w o r l d

I think that should be

Hello, world
````````````    // the 14 characters NL H e l l o , SP w o r l d NL

— John

P.S. When we get to library support, I will be looking for some
way to strip *at most* one leading and trailing non-quote character,
such as SP or pipe '|', in order to escape the restriction about
backticks beginning or ending raw strings.

The trim-margins stuff we talked about once will probably do,
if it can be configured to trim the SP/pipe char from the end
of the raw string as well as the beginning.  I like your idea of
trimming at most one blank line (NL) from the fore and aft, since
that supports multi-line expressions like the Hello, world example
above.  And a single-line idiom is desirable too.

More information about the amber-dev mailing list