Ref:  Stuart Halloway's talk: "Simplicity":

http://blip.tv/clojure/stuart-halloway-simplicity-ain-t-easy-4842694

Found via reading list: http://clojure.com/reading.html )

At one point in his talk he states that defrecord is in fact basically
"documented, named [typed] structure".
(as opposed to a standard map).
This I thought was quite genius.

But on further reflection I wonder if:

A: Doesn't this contradict another Clojure rationale:
"It is better to have 100 functions operate on one data structure than
to have 10 functions operate on 10 data structures." - Alan J.
Perlis   http://clojure.org/rationale

B: Is this not a form of optimization - (which may be premature)?

C: Is it best to use records only within an aplication, but to export
to generic maps when "serializing" data to a string og stream for
communication or storage ...
Is this the best way to "serialize" a record?:
   (into {} intance-of-my-record)
Would you "desiralize" it with a custom function like this?
  (fn [{key1 :key1, key2 :key2}] (MyRecord. key1 key2))  (calling it
like this: (my-fn map-to-be-destructure-and-recordfied)



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

Reply via email to