Block Lambdas: break and continue

Herby Vojčík herby at mailbox.sk
Wed Jan 18 14:49:53 PST 2012


Brendan Eich wrote:
>> Herby Vojčík <mailto:herby at mailbox.sk>
>> January 18, 2012 2:34 AM
>> Brendan Eich wrote:
>>>>> Perhaps what I'm saying is that I think "do:" is a label for the
>>>>> whole
>>>>> callexpression, covering all lambda-block parameters. As far as the
>>>>> specification goes, a continue that 'hits' the block lambda may well
>>>>> be best described as a local return.
>>>>
>>>> Yes, this seems about right. But can this behavior for break/continue
>>>> be explained in a way that doesn't seems arbitrarily different from
>>>> break/continue in the context of /IterationStatements/ and regular
>>>> blocks.
>>
>> Maybe you can, after all, read my post on the topic from few days ago.
>> It is not _that_ long, it does break/continue with specifying value,
>> and it gives them concise meaning (which is easily updateable for case
>> of "label: { ....; break label; ... }" as well as "for call() {||
>> ...})".
>
> Priivate reply here.
>
> Using | delimiters around an optional expression after break or continue
> is a pipe too far. Just IMHO. We can bikeshed the syntax but Allen's
> 'with' retasking seems better.

Why not? It is not about syntax in the first place. I used | bars to 
"hint" that value-returning continue semantics (and break, too, if I 
think about it) is useful primarily in context of lambda-blocks. It may 
be with (but you sounded you do not want to have continue returning 
value at all).

If module-opt-in or whatever-new-opt-in strategy fails and 
feature-by-feature opt-in would come to place, I would see good use of 
with there, by saying

with newObjectLiteral, destructuringAssignment

construct to opt-in features. Otherwise, with is ok.

> Also (I'm in a glass house on this due to volume of HTML overciting and
> broken images my new mail user-agent has sent, so please do not take
> this as me throwing a stone) your post still should be shorter to be
> more persuasive, or just digestible.

I have sent lot of mali which tried to be short and in medias res. I was 
misunderstood and always got a short reply. So I wanted to explain more. 
It's hard to balance.

> Just above you reply to Allen's cited text, not mine. Earlier I said I'd
> write a separate strawman for block-related ideas (do: and
> break/continue with value). So I'm not sure what you are asking me to
> do, other than consider |-delimiting instead of Allen's
> break/continue-with. Is that it?

As I said, it's not about syntax. I have replied primarily to the fact 
that you (plural you) have searched for concise break/continue semantics 
in context of old use and at the same time in the calls with block 
lambdas, I pointed out that I included it in my post, which is a bit 
long, but it is there, all; with the try to explain why, not only what 
and how.

> /be

Herby


More information about the es-discuss mailing list