Yes, but I don't want to load all the parts at once. I may have four records that will be part of MyFoo, but I only ever need one - maybe List3 in this case. That's why it's dynamic and why I have the problem in the first place.
Bill On Jul 28, 12:40 pm, Armando Blancas <armando_blan...@yahoo.com> wrote: > > It seem to me there should be some way to load a record at run time > > without breaking the immutability laws. Once the dynamic data is > > loaded, the record becomes immutable and will never be changed > > again. > > Actually, that's how records work and is exactly the behavior of the > initial (foo. nil nil), after which the record is loaded and > immutable. If the loaded data must be bound to MyFoo: > > (def MyFoo (foo. (load-data-from-file f1) (load-data-from-file f2))) > > or you might consider making Myfoo a ref instead of each subrecords, > seems simpler that way. -- 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