String reboot - (1a) incidental whitespace
Liam Miller-Cushon
cushon at google.com
Fri Apr 19 18:09:47 UTC 2019
On Fri, Apr 19, 2019 at 6:41 AM Jim Laskey <james.laskey at oracle.com> wrote:
> The first line has no influence and is not affected by the indentation
> provided by the close delimiter influence.
>
Sorry, I may have gotten confused. That seems to be a different approach
than the one Brian described in:
sometimes putting text on that first line is exactly what you want, such as
> in the case where you _dont_ want alignment to muck with your indentation.
> Putting non-blank text on that first line is effectively an opt-out
I still see room for confusion in either approach to handling the first
line, and disallowing string contents on the same line as the opening
delimiter has the potential to file a sharp edge off the feature. As Brian
mentioned that restriction could also be accomplished with a style rule,
but I don't see much downside to including the restriction in the language.
Maybe more interesting is that the both following work as an alternative
> pattern;
String m = """I won’t
get any alignment
(except maybe NL normalization)
""";
My concern is that you can't tell from reading the code whether that works
because the implementation ignores the first line, or because it uses the
column position for re-indentation, so you might expect it to be equivalent
to:
String m = """ I won’t
get any alignment
(except maybe NL normalization)
""";
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/amber-spec-experts/attachments/20190419/1e198883/attachment.html>
More information about the amber-spec-experts
mailing list