May 2018
Beginner to intermediate
290 pages
6h 43m
English
The word protocol is one of those nontechnical terms—it originally meant the set of rules for coping with a visit from the ambassador from Naboo and similar situations—that has picked up a variety of technical meanings, mostly around networking and communications. The meaning of protocol in Clojure is closer to the diplomatic original. A Clojure protocol is a set of how to behave rules expressed in code.
To see how protocols work, let’s imagine that along with the FictionalCharacter. we had a second record type, one used to track employees at a company:
| | (defrecord Employee [first-name last-name department]) |
Nothing is really new here: Employee is just a record type with three fields. Armed with this new definition, we can cook up ...
Read now
Unlock full access