On Sat, Jul 02, 2005 at 08:55:34AM +0200, demerphq wrote:
> The entire basis of computer science is based around the idea that if
> you do the same operation to two items that are the same the end
> result is the same.

Citing "computer science" as the basis of your position is just too
much.  The "computer science" answer to the comparison of references is
that they are equal if and only if they are the same reference.
Otherwise, one will always be able to observe differences between them,
and in Perl it's particularly easy:

    $a = [];
    $b = [];
    is_deeply($a, $b);  # you say should pass
    $a = "$a";  # doing the same operation
    $b = "$b";  $ to $a and $b
    is_deeply($a, $b);  # fails

That this is just one example, and if you try to worm out by saying
"such-and-such operation is not allowed", I'll find you another.

So neither position is "right", though either could be useful in a
particular case.  I agree with you (yves) that considering aliases
within the objects being compared could be useful.  I also think that
any such comparison should allow objects to override the comparison.
Finally, I think that comparing functions (which started this
discussion) is insane!

Andrew

Reply via email to