777 karma · joined April 25, 2010
[1]: https://gist.github.com/c-spencer/6569571 (just a PoC)
Still fairly early days on that though (missing protocols and rest parameters are the big issues I think)
(let [x (f (first s))]
(if (nil? x)
(keep f (rest s))
(cons x (keep f (rest s)))))
Which looks almost identical (with differences, as you seem to be giving filter rather than keep, which are different functions). The library function COULD be defined like this, it just wouldn't be as fast.A throttled run-forever version.
edit, slightly neater:
(function draw(i){ setTimeout(function (){ document.write(i%30==0 ? '<br>' : Math.random()>0.5 ? '\u2571':'\u2572'); draw(i+1); }, 100) }(1))
There's still a high demand for good developers in the UK, main issue in recruitment is sifting through the many applicants for positions who, even with experience, show no aptitude for the job.
Not that it's bad to know how to do it yourself, but I'd make sure my implementation was sound before sharing it as advice.
Fitting in with the community style/idioms is rather important for a project, especially as it grows in size. When it's a huge codebase, used by many, in many different use-cases, people being able to look into the code to help sort out their own issues is hugely valuable. If someone who knows your programming language and knows your problem domain gets scared off by how your software is architectured/functions, that's not a particularly good sign.
But maybe the problem is huge, and all that complexity is needed, and will pay-off now they're looking to have multiple VM providers. But criticism of complexity shouldn't just be tossed aside as 'trashing'.
(webnumbr looks really nice for watching random pages that don't have dedicated trackers, though)
So for instance:
var arr1 = [1,2,3], arr2 = [1,2,3,4];
console.log(arr1 + arr2); // "1,2,31,2,3,4"
arr1.valueOf = function () { return this.length; };
arr2.valueOf = arr1.valueOf;
console.log(arr1 + arr2); // 7In terms of real-world scripting, almost any script I've benchmarked has always been ~1.5-2 times faster in Chrome than firefox (versions 4 through 6), except when bound by API calls (last I checked Firefox was on-par or better when dealing with TypedArrays). It looks like TypeInference might be a really big win though.