Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
object equivalence
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Andrew Hume  
View profile  
 More options Jul 24 2007, 11:55 am
From: Andrew Hume <and...@research.att.com>
Date: Wed, 25 Jul 2007 00:55:25 +0900
Local: Tues, Jul 24 2007 11:55 am
Subject: object equivalence

i have two objects, a and b, both of the same class.
i believe they have the same contents, but
        a.eql?(b) returns false

if i write a method xxx that returns as a string the value of every  
field
(much as to_s does), then a.xxx.hash == b.xxx.hash.
i believe this latter shows a and b are equivalent; o why
doesn't eql? agree?

------------------
Andrew Hume  (best -> Telework) +1 732-886-1886
and...@research.att.com  (Work) +1 973-360-8651
AT&T Labs - Research; member of USENIX and LOPSA


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Todd Benson  
View profile  
 More options Jul 24 2007, 2:27 pm
From: "Todd Benson" <caduce...@gmail.com>
Date: Wed, 25 Jul 2007 03:27:01 +0900
Local: Tues, Jul 24 2007 2:27 pm
Subject: Re: object equivalence
On 7/24/07, Andrew Hume <and...@research.att.com> wrote:

> i have two objects, a and b, both of the same class.
> i believe they have the same contents, but
>         a.eql?(b) returns false

> if i write a method xxx that returns as a string the value of every
> field
> (much as to_s does), then a.xxx.hash == b.xxx.hash.
> i believe this latter shows a and b are equivalent; o why
> doesn't eql? agree?

eql? is just a method and therefore depends on the implementing
object.  By default, eql? returns true only if the objects being
compared are the _same_ object.  And then, each class typically
overrides eql? to do as the developer sees fit.

Todd


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google