EDIT: I'm not sure if it is the case or not; I can't find definitive documentation and I don't have a REPL available. Anyone know for sure?
EDIT: I'm not sure if it is the case or not; I can't find definitive documentation and I don't have a REPL available. Anyone know for sure?
if you try to set a final field you'll get an exception as expected.
protected members when everything is immutable is pointless. Clojure cleanly separates values and identities.
Except when used to mark the boundary between a stable public API and an internal API that is free to change between releases.
When I release a new major version of Foo Lib, and your program refers to private members, your program will break when I remove or rename them.
Immutability won't protect you from that.
EDIT: Ha, i just stumbled on this old yegge article, which is quite appropriate i think. With clojure APIs you think in verbs, so nouns are not that important
http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom...
EDIT2 : perfect quote :
"In the remotest regions, beyond the Functional Kingdoms, lies a fabled realm called Lambda the Ultimate. In this place it is said that there are no nouns at all, only verbs!"
here you go ;)
I already live in that Kingdom, so when I say "members", I mean member variables or member functions.