A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-34.rb
1Point=Data.define(:x,:y)
2putsPoint.new(x:1,y:2)==Point.new(x:1,y:2)
3putsPoint.new(x:1,y:2)==Point.new(x:1,y:3)
Comparisons
Answer & explanation
Console output
true
false
Why
Like `Struct`, `Data` automatically defines `==` based on attribute values. Two `Point` instances with identical coordinates are equal even though they are different objects. This value-semantic equality is a core property of `Data` objects.