----- Mail original ----- > De: "Guy Steele" <[email protected]> > À: "mark" <[email protected]> > Cc: "amber-spec-experts" <[email protected]> > Envoyé: Jeudi 15 Mars 2018 20:18:34 > Objet: Re: break seen as a C archaism
>> On Mar 15, 2018, at 3:06 PM, Mark Raynsford <[email protected]> wrote: >> >> On 2018-03-15T14:50:45 -0400 >> Brian Goetz <[email protected]> wrote: >>> >>>> If you are reconsidering options, reconsider "yield", meaning >>>> "break current context with this value". >>> >>> Still feeling a little burned by first time we floated this, but willing >>> to try another run up the flagpole.... >> >> Silly idea, but... *puts on fireproof suit*: >> >> "finally x;" > > Interestingly, the keywords `try` and `catch` and `finally` currently must > each > be followed by a block, so there is indeed syntactic space to use each one > with > a following expression instead. > > Which only suggests that . . . *puts on fireproof suit and then climbs into a > concrete bunker and slams the door*: > > “try x;” > > would be shorter and no sillier. > > —Guy It seams too close to the try-with-resources. compare try (resource) -> { }; // a try that break/return a lambda with try (resource) { } // a try-with-resources Rémi
