3 ms·
This is one of Clojure's finer design choices, emphasis on values. Thus, = alway means deep equality, identical? for testing whether two values are actually the
by swannodette 15y ago
This is one of Clojure's finer design choices, emphasis on values. Thus, = alway means deep equality, identical? for testing whether two values are actually the same object.
- lurker19 15y agoYou mean "whether two values are actually the same 'value'", right? (So, "(cons A (cons B C)) = (cons A (cons B C))" even though allocated separately as two distinct instances and not cleverly optimized to the same storage in memory) Otherwise, I do not understand your comment, whih is lauding Clojure's preference for values over objects.
- swannodette 15y agoBy "object" I mean same storage in memory. Clojure does optimize literal data and identical? test does come first when using =.