Re: Questions regarding Map vs Record and usage

2014-04-09 Thread Greg D
FWIW, I use: - (->Book "Lord of the Rings", "Tolkien") - when I define the record instance with the default fields, and the number of default fields is a small number - (map->Book {:title "The Fellowship of the Ring", :author "Tolkien",

Re: Questions regarding Map vs Record and usage

2014-04-09 Thread Ben Mabey
On 4/9/14, 12:51 PM, Anthony Ortiz wrote: 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"} You missed one: (map->Book {:title "Lord of the R

Re: Questions regarding Map vs Record and usage

2014-04-09 Thread A. Webb
You can refer-in the first (factory function) to another namespace; for the second you'd have to import the class. I prefer the first. The third is special syntax for the reader. As to the last question, I don't know, but it allows you to define your own. For example, (defrecord Book [tit

Questions regarding Map vs Record and usage

2014-04-09 Thread Anthony Ortiz
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 w