Re: Partial question

2016-02-25 Thread eliassonaand via Clojure
Hi, is this want you want? https://github.com/eliassona/apartial Regards Anders Den tisdag 23 februari 2016 kl. 19:14:33 UTC+1 skrev Fernando Abrao: > > Hello all, > > I´m trying to do something like: > > (defn log [type message & {:keys [id idVe] :or {id "LOCAL" idVe "END"}}] > (println (s

Re: Partial question

2016-02-23 Thread Leif
`partial` won't work here because you're partially applying *two* arguments, `type` and the :idVe portion of the &rest args. `partial` only lets you override an *unbroken* sequence of args at the *beginning* of the arglist. For instance, (partial log "DEBUG" "default message") would work. To

Re: Partial question

2016-02-23 Thread Fernando Abrao
Hello, it worked, but if I use (debug "TEST" :id "something") is getting ArityException Wrong number of args (3) passed to ... Em terça-feira, 23 de fevereiro de 2016 15:36:46 UTC-3, Josh Tilles escreveu: > > My guess is that what you're looking for is: > (def debug #(log "DEBUG" % :idVE "COM")

Re: Partial question

2016-02-23 Thread Josh Tilles
My guess is that what you're looking for is: (def debug #(log "DEBUG" % :idVE "COM")) (see "Anonymous function literal" under http://clojure.org/reference/reader#_dispatch) However, note that defining functions in a "point-free"-ish style in Clojure has a downside with regard to metadata, in tha