natively negotiating sync vs. async...without callbacks

Getify Solutions getify at
Fri Dec 10 06:55:06 PST 2010

>   Lastly, I'd say that function signatures which currently accept a
> callback also don't *have* to change. In fact, there may be some value in
> allowing both styles (existing callbacks, and my new proposed style) to
> co-exist in the same function, giving the calling developer the freedom to
> choose.

Another example of this would be existing interfaces in JavaScript which
accept callbacks, like `setTimeout`. Those interfaces could be extended to
also be aware of this new behavior, without changing their function
signature at all:

function foo() {
   console.log("foo rocks");

setTimeout(foo, 1000);
// or
setTimeout(null, 1000) @ foo();

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list