On Thu, Feb 3, 2011 at 9:36 PM, Quzanti <[email protected]> wrote:
> I probably should have clarified that the reason I need concat is that
> various functions are returning subsets of the arguments as vectors,
> but as stated to keep things simple in the example I just used values
I still recommend using maps. But one possible way:
(ns foo)
(defrecord Person [name age])
(defn create-person [name age]
(Person. name age))
(defn create [[ctor & args]]
(apply ctor args))
(create (concat [create-person] ["Peter"] [18])) ;; #foo.Person{:name
"Peter", :age 18}
I see no reason for the ctor to be defined as a string as you've done with
"Person.".
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en