On Wed, Oct 26, 2011 at 9:24 AM, Alex Miller <a...@puredanger.com> wrote: > I need to correct that p2 and m1 should not have parens around > them.... sorry about that. Seemed obvious when I read it again this > morning. > > The literal reader forms are even trickier in how they treat embedded > expressions. They seem to preserve (and not evaluate) the quoted > forms? > > user=> (def p #user.Person[(str "a" "b") "c"]) > #'user/p > user=> p > #user.Person{:first (str "a" "b"), :last "c"} ;; note the embedded > str here, not "ab" > user=> (:first p) > (str "a" "b") ;; aroo? > > Surely, this is not the intended behavior?
I suspect it is intended. You certainly wouldn't want those interior forms evaluated at reader time. To be more like literal vectors and maps, eval would have to know how to handle each record type, find the forms contained in the values, evaluate them, and build a new record with the results. Off the top of my head I don't see why this would be impossible, but it may not be desirable. --Chouser -- 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