Archive for the ‘closures’ Category

Manual code specialization:a poor-mans partial evaluation in JavaScript

Friday, July 4th, 2008

Recall the object function that Douglas Crockford is promoting in his work on prototypal inheritance in JavaScript: function object(p) { function F(){} F.prototype = p; return new F(); } The object function creates a new object which has the input object (p) as it's prototype. On the comp.lang.javascript ...