On Thu, Feb 3, 2011 at 9:36 PM, Quzanti <[email protected]> wrote:
>
>
> On Feb 4, 2:23 am, Kevin Downey <[email protected]> wrote:
>
>> whole crazy concat thing
>> which has nothing to do with anything
>
> 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
Were you aware that records support assoc (and as a side-effect,
merge)? You end up with a new record as with all clojure immutable
datastructures, but this is how you can build records up "a piece at a
time".
(defn complicated-function [params]
(let [p (Person. nil nil)
parammap (zipmap [:name :age] params)]
(merge p parammap)))
user=> (complicated-function ["Aaron" 31])
#:user.Person{:name "aaron", :age 31}
--Aaron
--
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