The term is not merely a recent appropriation. Parametric polymorphism is a concept from functional programming and formal type theory, with application far beyond just JavaScript.
HN user
nickfargo
~@G|gh|tw
That's interesting, because I find #() rather less easy to parse compared to (comp) or (partial) for otherwise equivalent expressions.
At a glance I know that (comp f g h) and its flat list of arguments expresses a simple function composition chain. Seeing a #(f (g (h %))) where (comp) will do makes me sift through more parens; more than that though, when (comp) is embraced as convention, a #() is an immediate cue that simple function composition is not what's being expressed, which draws me in necessarily to examine the particular structure of the #() body.
This is a different notion of polymorphism, yes.
Suggested reading: http://mrale.ph/blog/2015/01/11/whats-up-with-monomorphism.h...
just use a closure!
Of course, but that means allocating a closure object per method per instance. When people say they want private variables, they mean they want them available in regular prototype-mounted methods. Proxies are one way ES6 lets you implement that. (Another is to use a WeakMap structure alongside a constructor, where each instance created by the constructor is mapped to a separate object that holds the "private" properties of that instance. Methods close over the WeakMap, but, crucially, are defined once on the constructor's prototype.)
ls -l /usr/local/bin/node
lrwxr-xr-x 1 502 staff 4 Jan 13 20:10 /usr/local/bin/node -> iojs
Is this necessary?A generator is an iterator created and returned by a generator function.
People whose opinions of you really matter know that the green boxes don't.
Referencing C10k implies yes. Threads cost.
The "looks more pleasant?" test can be valid only between cljs/Om and the CoffeeScript from which the generated JS was compiled.
By presenting Coffee's not-quite-idiomatic JS output as the counterpoint, the otherwise well made argument for Om's pleasantness is weakened.
Pretty big rush to judgement. Slice off a copy of the arguments if you need them, but
pall = -> console.log line for line in arguments; return
would have done just fine there.One can be annoyed by `return` in tail position, or delighted by invocations-as-expressions. But not both. It's ok to choose the latter. :-)
Also, `console.log` is not a fit for map, forEach, et al. Check the parameters.
And moreover,
describe 'syntax after upgrading', ->
it 'should be even meatier', ->
expect parentheses.required
.toBe false
Very tidy.I have understood “performant” to suggest a soundness of design that causes something to be “fast”. In the context of algorithms, certainly the distinction is blurred, but in other, higher-level contexts, it can be meaningful.