May 2018
Beginner to intermediate
290 pages
6h 43m
English
So if records are just maps with some fields wired in, are they really worth the bother? As usual, the answer is it depends. One concrete advantage of records is that getting at the hard-wired fields is faster than getting at the equivalent fields in a map. Thus, if you had this:
| | (def irene {:name "Irene Adler" |
| | :appears-in "A Scandal in Bohemia" |
| | :author "Doyle"}) |
you would expect that this would be faster:
| | (:name watson) |
than this:
| | (:name irene) |
How much faster? Certainly not enough to matter if you are only dealing with a few novels—or a few tens of thousands. But if you are dealing with seriously large mounds of data, the performance advantages of records are something to consider.
Another reason to use ...
Read now
Unlock full access