String reboot (plain text)

Liam Miller-Cushon cushon at google.com
Wed Mar 13 19:42:29 UTC 2019


On Wed, Mar 13, 2019 at 12:10 PM Brian Goetz <brian.goetz at oracle.com> wrote:

> For example, we miss out on the opportunity to do text reflow on
> non-raw-ML strings and not do it on raw-ML strings (I don’t think we can
> really justify doing it automatically on raw strings; that’s not what raw
> means.)
>

For my understanding, is this something you could expand on?

I appreciate the pedagogical simplicity of "raw means raw", instead of
having to understand nuances of automatically adjusting indentation when
thinking about raw strings. There are clearly tradeoffs here, but it isn't
obvious to me that reflowing indentation for raw strings is fatally flawed.
And there are advantages: it decouples formatting and indentation choices
from the value of the string literal, and many raw strings (especially
foreign code) won't care about the leading whitespace anyway, and for cases
where the leading whitespace is needed there are advantages to a library
solution (reading `.indent(20)` is easier than counting 20 spaces).

One thing I found noteworthy from the swift proposal was that both their
multi-line and raw strings automatically manage leading indentation.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/amber-spec-experts/attachments/20190313/01474c64/attachment-0001.html>


More information about the amber-spec-experts mailing list