Re: Comparing Object Identity (was: Re: Stringification of references (Decision, Please?))

2002-12-13 Thread Rafael Garcia-Suarez
Simon Cozens <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] (Larry Wall) writes: > > Which basically comes down to this: an id represents a location in > > memory for any objects that don't override the .id method. > > Aiee! No! Please don't let things override the address-in-memory method, > as

Re: Comparing Object Identity (was: Re: Stringification of references (Decision, Please?))

2002-12-12 Thread Simon Cozens
[EMAIL PROTECTED] (Larry Wall) writes: > Which basically comes down to this: an id represents a location in > memory for any objects that don't override the .id method. Aiee! No! Please don't let things override the address-in-memory method, as that makes foo.id == bar.id comparisons dubious at b

Re: Comparing Object Identity (was: Re: Stringification of references (Decision, Please?))

2002-12-12 Thread Michael Lazzaro
On Wednesday, December 11, 2002, at 06:48 PM, Dave Storrs wrote: Hopefully, this thread has been settled by Damian's pointing out the existence of id(), but could I put in a strong vote against the use of '===' for anything? It is far too easy to misread as ==, IMHO. Yes, I think it's settled

Re: Comparing Object Identity (was: Re: Stringification of references (Decision, Please?))

2002-12-12 Thread John Siracusa
On 12/12/02 12:55 PM, Larry Wall wrote: > As for namespace pollution and classes that use .id in Perl 5, I > don't think it's going to be a big problem. Built-in identifiers > do not have a required prefix, but they have an optional prefix, > which is C<*>. I think we can probably parse > > $a

Re: Comparing Object Identity (was: Re: Stringification of references (Decision, Please?))

2002-12-12 Thread Larry Wall
On Thu, Dec 12, 2002 at 12:20:18PM -0500, James Mastros wrote: : (This is a reply to a mail accidently sent to me personaly instead of : the list. Buddha, care to resend your other mail? I havn't quoted it : in total.) : : On 12/12/2002 9:43 AM, Buddha Buck wrote: : : >James Mastros wrote: :

Re: Comparing Object Identity (was: Re: Stringification of references (Decision, Please?))

2002-12-12 Thread Buddha Buck
(resent as requested) James Mastros wrote: Here's my basic defintion of ID: Two things should have the same ID if-and-only-if they will behave exactly the same, now and forevermore. Thus, there should be one ID for all constants of the same value, which is different from all constants of diff

Re: Comparing Object Identity (was: Re: Stringification of references (Decision, Please?))

2002-12-12 Thread James Mastros
(This is a reply to a mail accidently sent to me personaly instead of the list. Buddha, care to resend your other mail? I havn't quoted it in total.) On 12/12/2002 9:43 AM, Buddha Buck wrote: James Mastros wrote: Here's my basic defintion of ID: Two things should have the same ID if-and-on

Re: Comparing Object Identity (was: Re: Stringification of references (Decision, Please?))

2002-12-12 Thread John Siracusa
On 12/11/02 11:41 PM, Luke Palmer wrote: >> More generally, I really don't want to have too many (any?) "system" object >> method names squatting in "my" all-lowercase object method namespace. It's >> not hard to think of many kinds of objects that would naturally have an "id" >> attribute, but mu

Re: Comparing Object Identity (was: Re: Stringification of references (Decision, Please?))

2002-12-12 Thread James Mastros
On 12/12/2002 5:50 AM, Aaron Crane wrote: Damian Conway writes: There's no need for special methods or (gods forbid) more operators. Just: $obj1.id == $obj2.id That's what the universal C method is *for*. How universal are universal methods? That is, can a programmer override .id() in a

Re: Comparing Object Identity (was: Re: Stringification of references (Decision, Please?))

2002-12-12 Thread Aaron Crane
Damian Conway writes: > There's no need for special methods or (gods forbid) more operators. > Just: > > $obj1.id == $obj2.id > > That's what the universal C method is *for*. How universal are universal methods? That is, can a programmer override .id() in a user-defined class? If so, simpl

Re: Comparing Object Identity (was: Re: Stringification of references (Decision, Please?))

2002-12-12 Thread Dave Storrs
On Wed, Dec 11, 2002 at 02:54:18PM -0800, Dave Whipp wrote: > "Michael Lazzaro" <[EMAIL PROTECTED]> wrote: > > After thinking about it a little more, I'll set myself on the "yes" > > side. And propose either '===' or ':=:' to do it. > > Definitely '==='. Hopefully, this thread has been settled

RE: Comparing Object Identity (was: Re: Stringification of references (Decision, Please?))

2002-12-12 Thread Brent Dax
Luke Palmer: # > There's no need for special methods or (gods forbid) more operators. # > Just: # > # > $obj1.id == $obj2.id # > # > That's what the universal C method is *for*. # # I rather like that. It's used for hashing by default (in # absence of a stringification or .hash (?) method

Re: Comparing Object Identity (was: Re: Stringification of references (Decision, Please?))

2002-12-11 Thread Dan Sugalski
At 9:43 PM -0700 12/11/02, Luke Palmer wrote: > Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm X-Sent: 11 Dec 2002 23:16:30 GMT Date: Thu, 12 Dec 2002 10:16:26 +1100 From: Damian Conway <[EMAIL PROTECTED]> X-Accept-Language: en, en-us X-SMTPD: qpsmtpd/0.20, http://develooper.com/code

Re: Comparing Object Identity (was: Re: Stringification of references (Decision, Please?))

2002-12-11 Thread Luke Palmer
> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm > From: "Dave Whipp" <[EMAIL PROTECTED]> > Date: Wed, 11 Dec 2002 14:54:18 -0800 > Organization: Fast-Chip inc. > X-Priority: 3 > X-MSMail-Priority: Normal > X-Newsreader: Microsoft Outlook Express 5.50.4920.2300 > X-MimeOLE: Produced By Micro

Re: Comparing Object Identity (was: Re: Stringification of references (Decision, Please?))

2002-12-11 Thread Luke Palmer
> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm > X-Sent: 11 Dec 2002 23:16:30 GMT > Date: Thu, 12 Dec 2002 10:16:26 +1100 > From: Damian Conway <[EMAIL PROTECTED]> > X-Accept-Language: en, en-us > X-SMTPD: qpsmtpd/0.20, http://develooper.com/code/qpsmtpd/ > > There's no need for special m

Re: Comparing Object Identity (was: Re: Stringification of references (Decision, Please?))

2002-12-11 Thread Luke Palmer
> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm > Date: Wed, 11 Dec 2002 19:21:35 -0500 > From: John Siracusa <[EMAIL PROTECTED]> > Reply-To: [EMAIL PROTECTED] > X-SMTPD: qpsmtpd/0.20, http://develooper.com/code/qpsmtpd/ > > On 12/11/02 6:16 PM, Damian Conway wrote: > > There's no need for

Re: Comparing Object Identity (was: Re: Stringification of references (Decision, Please?))

2002-12-11 Thread John Siracusa
On 12/11/02 6:16 PM, Damian Conway wrote: > There's no need for special methods or (gods forbid) more operators. > Just: > >$obj1.id == $obj2.id > > That's what the universal C method is *for*. I must have missed this (or forgotten it?) Any chance of it becoming .ID or .oid or even ._id? I

Re: Comparing Object Identity (was: Re: Stringification of references (Decision, Please?))

2002-12-11 Thread Buddha Buck
Dave Whipp wrote: "Michael Lazzaro" <[EMAIL PROTECTED]> wrote: After thinking about it a little more, I'll set myself on the "yes" side. And propose either '===' or ':=:' to do it. Definitely '==='. I could also see :== or =:= as well. If we have $obj1 = $obj2; then presumably, ($obj1

Re: Comparing Object Identity (was: Re: Stringification of references (Decision, Please?))

2002-12-11 Thread Damian Conway
There's no need for special methods or (gods forbid) more operators. Just: $obj1.id == $obj2.id That's what the universal C method is *for*. Damian

Re: Comparing Object Identity (was: Re: Stringification of references (Decision, Please?))

2002-12-11 Thread Dan Sugalski
At 2:28 PM -0800 12/11/02, Michael G Schwern wrote: On Wed, Dec 11, 2002 at 02:15:40PM -0800, Michael Lazzaro wrote: On Wednesday, December 11, 2002, at 11:16 AM, Luke Palmer wrote: >This brings up something that's been on the tip of my toungue for >awhile. In many object-oriented languages

Re: Comparing Object Identity (was: Re: Stringification of references (Decision, Please?))

2002-12-11 Thread Dave Whipp
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote: > After thinking about it a little more, I'll set myself on the "yes" > side. And propose either '===' or ':=:' to do it. Definitely '==='. This is used in various other languages. > >$obj1 eq $obj2;# [1] are their stringifications identical?

Re: Comparing Object Identity (was: Re: Stringification of references (Decision, Please?))

2002-12-11 Thread Michael G Schwern
On Wed, Dec 11, 2002 at 02:15:40PM -0800, Michael Lazzaro wrote: > On Wednesday, December 11, 2002, at 11:16 AM, Luke Palmer wrote: > >This brings up something that's been on the tip of my toungue for > >awhile. In many object-oriented languages we have seen that there is > >an important differen

Comparing Object Identity (was: Re: Stringification of references (Decision, Please?))

2002-12-11 Thread Michael Lazzaro
On Wednesday, December 11, 2002, at 11:16 AM, Luke Palmer wrote: This brings up something that's been on the tip of my toungue for awhile. In many object-oriented languages we have seen that there is an important difference between "equal" and "same." Perl already has two kinds of equal, but I