> On Mar 15, 2018, at 3:40 PM, Remi Forax <[email protected]> wrote:
> 
> 
> 
> ----- 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

Indeed.  Mine was not a serious suggestion.  I agree with John Rose’s analysis: 
“break x;” really does seem to be the best point in the design space, 
especially since you can use “->” to hide it 98% of the time.

        "But I was thinking of a plan
        To dye one's whiskers green,
        And always use so large a fan
        That they could not be seen.”

                —Lewis Carroll


Reply via email to