Thursday, April 23rd, 2009
I've often needed to do a combination of filtering and mapping on arrays. E.g. in a Ruby on Rails app, I might have a list of "RecurringActivation" model objects which have a product_id and an integer period. Now I would like a list of product_ids where the current time "matches" ...
Posted in Clojure, performance | No Comments »
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 ...
Posted in JavaScript, closures, code specialization, partial evaluation, performance, sharing | No Comments »