> De: "John Rose" <john.r.r...@oracle.com> > À: "Remi Forax" <fo...@univ-mlv.fr> > Cc: "Jim Laskey" <james.las...@oracle.com>, "compiler-dev" > <compiler-...@openjdk.java.net>, "core-libs-dev" > <core-libs-dev@openjdk.java.net> > Envoyé: Mardi 5 Novembre 2019 19:35:45 > Objet: Re: RFR: CSR JDK-8233117 Escape Sequences For Line Continuation and > White > Space (Preview)
> On Nov 5, 2019, at 10:17 AM, Remi Forax < [ mailto:fo...@univ-mlv.fr | > fo...@univ-mlv.fr ] > wrote: >> the rationale to add \<newline> is well explain but why do you want to >> introduce >> \s given we already have \u0020 ? > Remi, you are an expert in the field and you got fooled! This is *exactly* why > we need \s. > The \uXXXX syntax is expanded *before* token scanning, which means that the > poor > programmer > who tries \u0020 will see it stripped by the whitespace stripper. Using \uXXXX > where XXXX is > an ASCII code point is an anti-pattern! (I think we would help our users if we > deprecated it.) I was not thinking of the case where you put a \u0020 inside a text block at the beginning/end of a line :) I still think that i prefer to have a clear delimiter like '|' and a calls to replace('|', ' ') like this private lazy static final String text = """ | this | | is | | fun | """.replace('|', ' '); > You might have said \040, but that too is hard to remember and to read and to > use correctly. > \s is the answer. > — John Rémi