[Pdx-pm] is_deeply and objects

Ovid publiustemp-pdxpm at yahoo.com
Fri Feb 25 15:58:42 PST 2005


--- Josh Heumann <perl-pm at joshheumann.com> wrote:
> Advocating devilishly, what are the arguments for it failing?  If
> there
> are two objects, blessed with the same class and containing the same
> data,
> are they really different?

Schwern's objects were not blessed into the same class.  One was a
subclass of the other.  Whether or not your application should consider
Foo->new or Bar->new to be the same things depends upon the particular
needs of the application.  To have is_deeply() automatically say that
different classes are the same, regardless of whether or not they're in
the same inheritance heirarchy would be deeply flawed.

Cheers,
Ovid

=====
If this message is a response to a question on a mailing list, please send
follow up questions to the list.

Web Programming with Perl -- http://users.easystreet.com/ovid/cgi_course/


More information about the Pdx-pm-list mailing list