natively negotiating sync vs. async...without callbacks
Getify Solutions
getify at gmail.com
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();
--Kyle
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20101210/5ab3fe7d/attachment.html>
More information about the es-discuss
mailing list