2 ms·
The point they raise is valid, though the tone is lacking. If you want to define a graph data structure, cycles are inherent, so there must be some way to deal
by tsimionescu 6y ago
The point they raise is valid, though the tone is lacking.
If you want to define a graph data structure, cycles are inherent, so there must be some way to deal with them - they are not something that can simply be ignored. This is a completely practical problem, and identity instead of value equality is a valid answer. Of course, this doesn't contradict the original article: reference equality can still exist in the language, it just helps if it's not the default.
For example, in Common Lisp you have both `eq` (reference equality) and `equal` (typed value equality) [and even the somewhat stranger `equalp` (structural equality, e.g. (equalp '(1 2) '(1 2)) -> true)].