Allen's lambda syntax proposal

David-Sarah Hopwood david.hopwood at industrial-designers.co.uk
Sat Dec 6 18:37:59 PST 2008


Jon Zeppieri wrote:
> On Sat, Dec 6, 2008 at 11:49 AM, Maciej Stachowiak <mjs at apple.com> wrote:
>> On Dec 5, 2008, at 11:12 PM, Jon Zeppieri wrote:
>>
>>> I don't get it.  What issue is raised by return-to-label that isn't
>>> already raised by exceptions? [...]
> Also, what was the performance issue?

The (minor) performance issue is that if there is a lambda that returns
from a given function, all calls within that function body must check
for an escape, even if the lambda is never passed to them or otherwise
accessible to them. Similarly for calls within the scope of a labelled
statement or iteration that contains a lambda with a corresponding
'break' or 'continue'.

Exceptions, OTOH, are implementable without an explicit check on each
function call.

Just this performance issue on its own wouldn't be significant -- it
might matter in a language that is otherwise highly optimizable, but
not in ECMAScript. I'll address the safety issue separately.

-- 
David-Sarah Hopwood


More information about the Es-discuss mailing list