Trailing white-space in text blocks
john.r.rose at oracle.com
Wed May 22 19:26:43 UTC 2019
On May 20, 2019, at 8:36 PM, Tagir Valeev <amaembo at gmail.com> wrote:
> Nevertheless after a hour or two, probably asking a colleague to help
> I will find the cause: the problem is really caused by the compiler.
> So I will spend another hour to find how to work-around it. I will see
> that escapes are handled after whitespace removal, thus will try to
> replace trailing spaces with \u0020 (very few developers are aware
> that it's not an actual string literal escape sequence). I will
> probably consult StackOverflow and find nothing. At the end I will
> give up and return to good old plain string literal. Not very
> productive day.
> I'm not sure how to avoid such scenario if trailing whitespaces are
> actually stripped. I can think up some solutions how IDE could help
> pointing at the actual problem cause, but not every IDE could be smart
> enough to help user in such scenario.
Yes, this is why we want <\ s> as a new escape sequence.
<\ 0 4 0> is not clear enough, but it is better than nothing.
(And <\ 0 0 2 0> is a disaster, which nobody but me seems
to want to address? Moving on…)
Significant trailing space at line ends is a language design bug.
Visible escapes are the necessary fix.
In either case, the IDE which does the pasting into a text
block *must* detect trailing space and escape it.
More information about the amber-spec-observers