HN user

nickfargo

26 karma

~@G|gh|tw

Posts0
Comments13
View on HN
No posts found.
Readable Clojure 9 years ago

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.

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.)

Io.js 1.0.0 12 years ago
  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?

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.

CoffeeScript 1.7.0 12 years ago

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.

CoffeeScript 1.7.0 12 years ago

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.