Hi Sven, I was trying to do the same with my library tangrammer/defrecord-wrapper <https://github.com/tangrammer/defrecord-wrapper> and, just today, I found a couple of links that worked fine for that http://grokbase.com/t/gg/clojure/11cjvz1jda/defrecord-based-on-runtime-metadata http://stackoverflow.com/questions/3748559/clojure-creating-new-instance-from-string-class-name
I integrated the solution here making a lazy-seq of dynamic defrecords https://github.com/milesian/aop/blob/master/src/milesian/aop.clj#L20 hope it helps Juan El sábado, 17 de enero de 2015, 17:27:05 (UTC), Sven Richter escribió: > > Hi, > > I am trying to create record definitions dynamically during runtime. What > I would like to do is something like this: > > (defn mk-rec [record-name namespace arg-list] > (eval '(do (ns namespace) > (defrecord record-name arg-list)))) > > And then call it like this: > (mk-rec "A" "ns" [a b c]) > (->ns.A 1 2 3 ) > > I am trying out different things, but struggle to get it right or find > some tutorial for it. > > So if anyone is willing to share some working code I'd be really happy. > > Thanks, > Sven > -- 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.