On Friday, December 13, 2002, at 06:56  AM, John Siracusa wrote:
I'm saying that there are many kinds of objects that naturally want to have an "id" method or attribute that has nothing whatsoever to do with "this is the same object" comparisons. But if "id" is chosen as the name of the global "this is the same object" method in Perl 6, then no one can safely use a method named "id" (overridden or otherwise) for anything but "this is the same object" comparisons.
I agree 100%. I use .id *often* in my coding. Or more accurately, I must connect regularly with database tables that have 'id' as a field I need to extract. :-( (And postgresql uses 'oid' as a globally unique id.)

I think this is one (rare) case where an UPPERCASE or unusual name might not be a bad idea, so it will BRING ATTENTION to the fact that you're using a unusual method.

$obj.ID;
$obj.IDENTITY;

If don't think we'll have much of a chance at teaching people to _always_ use ($obj.*id == $obj.*id) instead of ($obj.id == $obj.id).

MikeL



Reply via email to