I see that there are several ways of instantiating a record :
(->Book "Lord of the Rings", "Tolkien")
(Book. "Lord of the Rings", "Tolkien")
#user.Book{:title "Lord of the Rings", :author "Tolkien"}
Questions :
1) The second version is referred to as the "original" version so I'm
wondering which is the preferred method.
2) Why is the third version not within a list? I thought that for the
language to consider something "callable" it had to be the first argument
in a list (eg : (+ 1 2))
3) The record that is returned via (def b [version of choice goes here]) is
treated as a map when using the form (:title b) but doesn't treat it as a
map when using the form (b :title) which seems pretty inconsistent to me;
is there are valid reason for this inconsistency? I'm sure I'm missing
something.
Thanks!
--
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
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.