The docs offer this example: 

https://clojuredocs.org/clojure.core/defrecord

user=> (defrecord Someone [nick-name preffered-drink] Fun-Time (drinky-drinky 
[_] (str nick-name "(having " preffered-drink "): uuumm")))
user.Someone

user=> (def dude (->Someone "belun" "daiquiri"))
#'user/dude

user=> (drinky-drinky dude)
"belun(having daiquiri): uuumm"

But if a record implements clojure.lang.IFn it can be called directly? Do I 
understand this correctly? When I run macroexpand-all on defrecord-ifn, as 
defined here: 

https://github.com/overtone/overtone/blob/e200075da27375727db1f5ce342e2e1c22ea1dbd/src/overtone/helpers/lib.clj

I see that it extends clojure.lang.IFn as in: 

clojure.lang.IFn 
(invoke [this__1446__auto__] 
  ((fn [this & args] 
    (apply synth-player sdef params this [:tail instance-group] args)) 
this__1446__auto__)) 
(invoke [this__1447__auto__ arg0] 
  ((fn [this & args] 
    (apply synth-player sdef params this [:tail instance-group] args)) 
this__1447__auto__ arg0)) 
// etc, all 20 arities are defined

So, that means I could call the record as a function? 


-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to