Re: revisiting shift

2010-04-28 Thread Peter van der Zee
On Tue, Apr 27, 2010 at 4:57 PM, David Herman dher...@mozilla.com wrote: Example: function f() { try { for (let i = 0; i K; i++) { farble(i); // suspend and return the activation let received = shift (function(k) { return

Error instances have no special properties?

2010-04-28 Thread Garrett Smith
Why does the specification state Error instances have no special properties? The ES5 specification states: | 15.11.5 Properties of Error Instances | Error instances inherit properties from the Error prototype | object and their [[Class]] internal property value is | Error. Error instances have

Re: revisiting shift

2010-04-28 Thread David Herman
What happens if you don't supply a function but another type, or none? The simplest thing is to specify it as a runtime error if the argument to shift is not callable. You're right that there's an overhead to constructing a new function. But it gives you flexibility that's otherwise a pain for

Re: revisiting shift

2010-04-28 Thread Peter van der Zee
I don't understand this question-- do you mean whatever value the handler function (in the example, function(k) { return k }) returns? Then no, there's no augmentation or mutation here. The continuation is represented as an object with three methods: Ah, I didn't know that. It'd be cleaner

Re: revisiting shift

2010-04-28 Thread David Herman
Hm. Maybe you meant to return the function to allow access to the local variable k through a closure? And not a fingerprint mixed shift(function) as I read it at first? I don't know what you're saying, but I have already posted the semantics in this thread. I *think* it should be pretty