On Saturday, August 4, 2012 1:15:13 PM UTC-4, Jim foo.bar wrote: > > for setting up objects as you say, I'm fine using (doto Object ... ... > ...). Records, as everything else in Clojure promote immutability and > so setting fields doesn't really make sense unless you're consuming > external java classes in which case 'doto' suffices...at least that is > the way I see it...I originally thought you were asking about how to > create a record at runtime via a macro or a function, which is actually > quite tricky (and I can certainly help), but what you're asking sort of > exists doesn't it? > > Jim > > > Here I am still creating immutable objects. You may say I am "setting" things, but that is for creating a new object. The new object itself is still immutable. It makes sense because when you create an object, the values of the fields may need to meet certain integrity requirements, or some transformation from the caller's arguments.
Functionally, of course we can do it, as you can create a record with any values for the fields. But in my view it is not the main objective to say "it works" , "it is powerful", "it give user freedom" when designing a language. My classic answer to those arguments is: how about assembly language? It definitely works, definitely powerful, and put no restrictions on the user. I know nobody who is a fan of such language. -- 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