4 ms·
If I understand the nature of this system, it's essentially a higher-order function composition tool. Correct? Nit, defnk? what about def-kw-func or something?
by pnathan 14y ago
If I understand the nature of this system, it's essentially a higher-order function composition tool. Correct?
Nit, defnk? what about def-kw-func or something? not wholly readable as defnk.
- w01fe 14y agoYep, that's correct. Point taken about the names, thanks for the feedback. Since Clojure already uses defn and fn, defnk and fnk seemed natural. But maybe defn-keyword and fn-keyword would be better.
- pnathan 14y agoI really like this idea. Do you have a Common Lisp port of this, out of curiosity? If not I might have to see what I can come up with. :-) I like to have fully expanded names, ala Common Lisp. My editor will autocomplete those on demand after I use a name once, so it's not a hindrance to reading or writing. My goal for identifiers is that I can read without consulting my internal lookup table.
- w01fe 14y agoThanks! Nope, no common lisp port -- and we haven't released the Clojure yet, but plan to soon. It's only 150 lines of code or so should be easy to port or rewrite from scratch.
- dkincaid 14y agoThere was a defnk at one time in one of the Clojure libraries (I think it was even created by Rich himself), but it disappeared at some point. Nathan Marz created a defnk macro in Storm that he uses for the same thing. Maybe it's time for Clojure to bring defnk back if it offers some advantages over the :keys destructuring.