Raw String Literals

John Rose john.r.rose at oracle.com
Thu Mar 22 19:29:20 UTC 2018

On Mar 22, 2018, at 1:32 AM, Stephen Colebourne <scolebourne at joda.org> wrote:
> public void varargs(String... strs) {
>  System.out.println(Stream.of(strs).collect(joining()));
> }
> varargs(`Hello`, ``, ` World! `, ``);
> .
> scroll down for the answer…

I'll be blunt here.

I didn't need to scroll down; it was obvious to me.  Perhaps because
I've spent a little more time gaining experience with Jim's proposal.
But maybe that's just me?

> […More complex proposal omitted.]

> In summary, not allowing an empty raw string is going to result in
> nasty puzzlers, and IMO unlimited delimiters by themselves is not in
> the spirit of Java. Following Markdown's approach of separation
> between single and 3+ backticks would provide considerable benefits to
> Java.

The only downside you mention is the puzzler you found.  And
the puzzler has, IMO, no shiningly obvious property that says,
"Jim's proposal is just wrong".

Can you guarantee that your more complex proposal has no such
puzzlers of its own?  It's not Jim's or my burden of proof to provide
such a puzzler as a counter example, since that would prove only that
we could play a non-terminating game of "find the puzzler in
each more complex proposal and argue which puzzler is worse".
Putting quotes inside of quotes is an opening move in that game.
I claim there is no closing move.

— John

More information about the amber-dev mailing list