2 ms·
Any posts which explain how the referential transparency built into the core libraries helps? My understanding is that Clojure is impure, so a "partially refer
by platz 13y ago
Any posts which explain how the referential transparency built into the core libraries helps? My understanding is that Clojure is impure, so a "partially referentially transparent" design is interesting to me.
Or are you just referring to the fact that the core data structures are immutable?
- adambard 13y agoClojure strongly encourages referential transparency (e.g. immutable data structures), but doesn't demand it (e.g. STM). The convention is simply to mark any function with side-effects with a !, which almost all external libraries follow. Without the !, you can have some confidence that a given function is pure, since pure functions are sort of the "default".
- platz 13y agoRuby follows this convention too, I believe; but probably to a lesser extent because it's core types aren't immutable