Joel VanderWerf
2/20/2005 3:14:00 AM
Martin DeMello wrote:
> It seems a bit of a waste for Array#=== to default to Object#=== - it'd
> be far more useful, IMO, to have it call include?. Can anyone see a
> drawback to this?
We'd lose this, FWIW:
points = [
[1,2],
[3,4],
[0,0]
]
points.each do |point|
case point
when [0,0]
puts "origin!"
end
end
To be a bit philosophical, I'd say that Arrays, unlike Regexps, do not
exist primarily to match, and so #=== should be Object#===.