3 ms·
A lot of the complexity comes from having a top-level type (Object) and inheritance. Functional languages often don't have this, so comparing two objects of dif
by skybrian 8y ago
A lot of the complexity comes from having a top-level type (Object) and inheritance. Functional languages often don't have this, so comparing two objects of different types doesn't come up. (Collections don't contain objects of different types either.)
- myWindoonn 8y agoSure, but most functional languages don't permit useful comparisons between functions of same type either, so while the complexity is limited, the power is limited as well.
- skybrian 8y agoWell, an equality function could be defined that compares closure values and instructions, as mentioned in the article. As I understand it, the reason it isn't typically done is conceptual: two functions are mathematically equal if the same inputs produce the same outputs. (The same way you'd define equality for a hashmap by comparing keys and values.) But this is impossible to calculate for arbitrary functions.
- willtim 8y agoThe power to reason is limited in complex languages.