Yes, my post references that and borrows the label syntax. These labels however do not return values and you can’t return from any ordinary scope.[quote=“cuviper, post:2, topic:5173”]
As for return, there were sort of similar ideas in this thread:
pre-RFC: Allow return, continue, and break to affect the captured environment language design
[/quote]
Not at all,in fact my idea excludes that. That’s a dynamic return that goes up and down a stack. Mine is completely lexical. Under my proposal a closure that has such a labelled return would be statically disqualified from ever leaving labelled scope it returns from.
You can in fact return from any scope with this such as:
let x = 'label:{
// complex code
if condition {
escape 'label:value; // premature exit from scope
}
// complex code
};