> 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 special methods or (gods forbid) more operators. > > Just: > > > > $obj1.id == $obj2.id > > > > That's what the universal C<id> method is *for*. > > I must have missed this (or forgotten it?) Any chance of it becoming .ID or > .oid or even ._id? I'm kind of attached to using an "id" method on objects > that represent things in a database... :-/
Well I use .str all the time, an .eq is one of my favorites! Don't take those, put a prefix on them! Theoretically, there are sufficiently few Object methods to warrant normal names. Also, when I write programs, I tend to design things to look as "built in" as possible. Once I've got a 500-line system going, I don't have to make the distinction between built in and my code, and modules' code. It's all part of the language, once I've put it there. In summary, my world view is that the language isn't there to help you code your own things; rather, you're extending the language constantly until the program can look like this: process for <>; > 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 must now have "foo_id" and "bar_id" methods because the > (probably rarely used) "id" method from UNIVERSAL (or whatever it is today) > is hogging it. I'd argue that you'd better pick a better name than .id anyway. You wouldn't use .foo_id and .bar_id, you'd use .descriptor or .index (though that one's not too much more descriptive than .index). I'd say .id should be kept short and sweet, because it's going to be used on a wider variety of objects than your database .id. > (The more I think about it, the more I like some kind of "reserved" prefix > like "_" or even "perl_"...but I'd accept "oid" :) die $human.oid; Luke