Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I was writing functions like this (Clojure):

  (defn set-password [{"login" login "password" password}]
    ...)
Ok, Clojure de-structuring syntax already makes things pretty terse: the function receives and de-structures a map. But for functions with many args it was looking repetitive, so I wrote defn* which lets me write the same as:

  (defn* set-password [login password]
    ...)
So, do you think this is a fair use of macros? It has the disadvantage of hiding the fact that the function actually receives a map, of course (but I'm a solo programmer here, trying to save keystrokes).


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: