|
|
|
|
|
by zonotope
2755 days ago
|
|
Clojure has facilities for seamless interop with Java (or whatever platform it's hosted on). A lot of times when inter-operating with Java libraries, you get back an opaque Object with associated methods when you'd normally expect a transparent Clojure map or some other pure data structure if you were interacting with a purely Clojure library. Datafy is just a protocol that allows you to transform those opaque Objects into transparent data structures. Clojure separates data from the functions that operate on it. In contrast, Objects intertwine those two things. You can roughly think of the "data" part of an Object as its attributes, and the "function" part its methods. |
|
1: an "atom" in clojure is not what it is in traditional lisp lingo; is there a name in clojure for type that is roughly the union of: symbol, number, character, boolean ? perhaps "primitive"?