|
|
|
|
|
by Roboprog
3669 days ago
|
|
Interesting points. As a matter of style, I still prefer using currying over "one trick pony" (single method/function) classes, though. Sometimes this means I have several "layers" of references to the original function, with varying numbers of parameters applied as each layer further specializes (adds configuration). I'm doing most of this type of work in Javascript, though, so YMMV. (PS - also did some work with Lisp in Uni back in the 80s, and sundry imperative/oop/func ; static/dynamic things since) |
|
Classes with one method are useful, but so are classes with multiple methods.
I just stumbled across this post again, and HIGHLY agree with it. Yegge is basically outlining why JavaScript is a better language than Emacs Lisp. I had the same experience with hacking on femtolisp and trying to write my shell in it.
http://steve-yegge.blogspot.com/2008/11/ejacs-javascript-int...
OCaml and Lisp both have problems with polymorphic print. There were some recent posts on HN about the expression problem, and the duality between FP and OOP, which I liked. But I have to say that print should be polymorphic, full stop. And if your functional language has problems with that, that's the language's problem and not my problem :)
Related:
http://stackoverflow.com/questions/2497801/closures-are-poor...
http://c2.com/cgi/wiki?ClosuresAndObjectsAreEquivalent