From: Vincent Marciante <marciant_remove@earthlink.net>
Subject: Re: Reemergence of predefined equality operator...
Date: Thu, 01 Aug 2002 01:30:57 GMT
Date: 2002-08-01T01:30:57+00:00 [thread overview]
Message-ID: <3D488F3D.6186@earthlink.net> (raw)
In-Reply-To: wcc7kjb1pm8.fsf@shell01.TheWorld.com
Robert A Duff wrote:
<snip>
> If you wanted to drive a stake through the heart of the predefined "="
> by declaring a user-defined "=", so that every time objects of type T
> are compared for equality it will call the user-defined "=", then you
> lose -- if you pass T to a generic or wrap T in a record, the predefined
> "=" reemerges (rises from the dead).
>
> For "=", this seems "obviously" wrong. But as I pointed out elsewhere,
> the situation for other operators (eg, "mod"), is not so obvious.
> Even if the language were changed, or even if Text_IO.Integer_IO took
> "mod" as an "is <>" parameter as above, it's not clear (to me) what the
> right answer is.
The crux of the problem in this specific case (generic private types)
seems to me to be _not_ reemergence but actually the new (Ada 95)
permission
to override predefied "=". (Allowing the definition of "=" with a
non-boolean result does not seem to be a problem.)
If overriding of predefined "=" was disallowed in the future (not
practical?) wouldn't that solve the problem well? Is that really
really not practical?
Vincent Marciante
next prev parent reply other threads:[~2002-08-01 1:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-31 22:25 Reemergence of predefined equality operator Dale Stanbrough
2002-07-31 22:47 ` Robert A Duff
2002-08-01 1:30 ` Vincent Marciante [this message]
2002-08-01 12:06 ` Robert Dewar
2002-08-25 17:46 ` Vincent Marciante
2002-08-25 22:04 ` Robert A Duff
2002-08-01 11:14 ` Dale Stanbrough
2002-08-01 14:48 ` Robert A Duff
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox