On Thu, Apr 18, 2019 at 8:52 AM Brian Goetz <brian.go...@oracle.com> wrote:
> 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) > > ”””; > I'm not sure that matches the behaviour of the current prototype, it doesn't seem to be considering the first line: String m = """I won’t get any alignment (except maybe NL normalization) """; Result of variable m I.won’t\n ....get.any.alignment\n ....(except.maybe.NL.normalization)\n \n