To align, or not to align?
alex.buckley at oracle.com
Sat Apr 20 00:53:26 UTC 2019
On 4/18/2019 11:32 AM, Brian Goetz wrote:
> One view is that a string literal is the sequence of characters between
> the delimiters, and a multi-line string literal is just a string literal
> that happens to be able to span lines. This is also the simplest
> extension of existing string literals to multi-line; adding only the
> ability to span lines. In this view, implicit alignment can feel like
> conflating two things.
> An alternate view is that a multi-line string is a literal that is
> embedded spatially in the Java source code; therefore it inherently has
> some 2D structure to it, which gives us permission to muck with it in
> certain ways that are consistent with that structure.
> So I think the question really comes down to: what _is_ a multi-line
> string literal.
I have a lot of time for the "alterate" view. Multi-line string literals
are not meant to be raw; some inference about the developer's intent for
the sea of whitespace on the left is fine (such as, "the developer is
not interested in it at all").
I do, however, think that a box-of-quotes (or even a lighterweight
marker for margins) makes the 2D denotation of a string overwhelming.
More information about the amber-spec-experts