Symbol equality method #= - weird condition in the Pharo sourcecode
March 1, 2019
4:08 p.m.
Hello, this is Symbol equality method in Pharo: 1: = aSymbol 2: "Compare the receiver and aSymbol." 3: self == aSymbol ifTrue: [^ true]. 4: self class == aSymbol class ifTrue: [^ false]. 5: "Use String comparison otherwise" 6: ^ super = aSymbol Look at line 4 - what does it mean? That's wrong, isn't it? Typically, every symbol comparisons end up in line 3, but if you do some work with forward proxies for example, condition on line 3 is "false" and then weird things on line 4 happens. If line 4 and further are correct, can someone explain a little? Thanks! pf
2708
Age (days ago)
2708
Last active (days ago)
0 comments
1 participants
participants (1)
-
Petr Fischer