String reboot - (1a) incidental whitespace
Brian Goetz
brian.goetz at oracle.com
Thu Apr 18 15:52:32 UTC 2019
> I still find the restriction appealing for the opening delimiter, though. The argument is that having contents on the opening line seems likely to cause confusion, e.g.:
>
> String m = """ +--------+
> | text |
> +--------+""";
>
> Result of variable m under the current string-tapas prototype:
>
> ....+--------+\n
> |..text..|\n
> +--------+
I think this is a restriction that is much more suitable to a _style guide_ than the language. Yes, users can get it wrong, but they’ll learn quickly. And, 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:
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/20190418/a2ebc75b/attachment.html>
More information about the amber-spec-experts
mailing list