Skip to content

Commit 31eca09

Browse files
committed
note on immutability
1 parent a3c83bf commit 31eca09

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sections/2-language-rules.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,12 @@ not change according to the object's history). Case classes are for
238238
strictly immutable things. If you need to mutate stuff, don't use case
239239
classes.
240240

241+
In the approximate words of Fogus in "The Joy of Clojure" or Baker in
242+
his paper from 1993: if any two mutable objects resolve as being equal
243+
now, then there’s no guarantee that they will a moment from now. And
244+
if two objects aren’t equal forever, then they’re technically never
245+
equal ;-)
246+
241247
### 2.6. SHOULD NOT declare abstract "val" or "var" or "lazy val" members
242248

243249
It's a bad practice to declare abstract vals or vars or lazy vals in

0 commit comments

Comments
 (0)