clojure - Extend "name" for custom record type -


i have record includes :name. there way tell clojure.core/name how extract :name out of record?

if you're able change defrecord declaration, implement clojure.lang.named interface there.

(defrecord myrecord [name]   clojure.lang.named   (getname [this]     (:name this)))  (name (myrecord. "dan")) ;;=> "dan"" 

Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -