Re: Call for bikeshed -- break replacement in expression switch

2019-05-15 Thread Guy Steele
> On May 15, 2019, at 7:35 PM, Doug Lea wrote: > . . . > (Meta: What do you call a bikeshed thread in which no one likes anyone > else's suggestions?) Cliqueless?

Re: Call for bikeshed -- break replacement in expression switch

2019-05-15 Thread Doug Lea
(With continuing deja vu...) On 5/13/19 3:48 PM, John Rose wrote: > The rule for developers is that if you > needed to put a {…} block after your > arrow ->, then you can still use an > arrow to return a value, but it must be > an extra arrow, marked with a keyword > (or syntax context) that me

Re: RFR: Multi-line String Literal (Preview) JEP [EG Draft]

2019-05-15 Thread Dan Smith
> On May 15, 2019, at 12:11 PM, Alex Buckley wrote: > > On 5/15/2019 10:17 AM, Dan Smith wrote: >> I think this: >> >> ~~~ >> String code = """ >> public void print(""" + type + """ >>o) { >> System.out.println(Objects.toString(o)); >>

Re: RFR: Multi-line String Literal (Preview) JEP [EG Draft]

2019-05-15 Thread Alex Buckley
On 5/15/2019 10:17 AM, Dan Smith wrote: I think this: ~~~ String code = """ public void print(""" + type + """ o) { System.out.println(Objects.toString(o)); } """; ~~~ should be presented like this: ~~~ String code

Re: RFR: Multi-line String Literal (Preview) JEP [EG Draft]

2019-05-15 Thread Dan Smith
> On May 15, 2019, at 11:35 AM, John Rose wrote: > > 2/4. Dan, I'm having trouble seeing your > idea of "prefix" in this example. Is it that > `String code = ` has the same number of > chars as there are spaces before `public` > (start of the first payload line)? This is hard > to read, I'm af

Re: RFR: Multi-line String Literal (Preview) JEP [EG Draft]

2019-05-15 Thread John Rose
1/4. FTR, an escape <\ LT> could clean that up a bit more, if the goal is to get the interpolation cruft on a separate line: ~~~ String code = """ public void print(\ """ + type + """ o) { System.out.println(Objects.toString(o));

Re: RFR: Multi-line String Literal (Preview) JEP [EG Draft]

2019-05-15 Thread Dan Smith
> On May 14, 2019, at 5:25 PM, Brian Goetz wrote: > >> Most of the examples in the JEP follow these rules as a convention already. >> The concatenation examples would benefit from following it. > > Sorry, not seeing it — how would the concatenation examples benefit? Example? > Sure, let me e

Draft language spec for JEP354: Switch Expressions

2019-05-15 Thread Gavin Bierman
Dear experts: A draft language spec for JEP 354: Switch Expressions can be found here: http://cr.openjdk.java.net/~gbierman/jep354-jls-201905.html [Note: This spec uses the break-with statement. There is a discussion elsewhere on alternatives for a different syntax. The spec will be updated as