I strongly recommend against writing or designing anything that
requires dynamically generating defrecords. if you want to dynamically
generate classes I suggest getting familiar with the asm library and
reading up on classloaders.

On Thu, Feb 3, 2011 at 6:49 PM, Quzanti <[email protected]> wrote:
> Thanks - that might well be part of the solution
>
> Person. is dynamically determined (i.e the result of a fn too)
>
> So I guess I am asking is there a way to dynamically resolve a
> classname?
>
> I found this
>
> http://dev.clojure.org/jira/browse/CLJ-370?page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel
>
> Does anyone know anything more about it, or where the sourcecode would
> be?
>
> On Feb 4, 2:44 am, Aaron Cohen <[email protected]> wrote:
>> 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



-- 
And what is good, Phaedrus,
And what is not good—
Need we ask anyone to tell us these things?

-- 
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

Reply via email to