comp.lang.ada
 help / color / mirror / Atom feed
From: claveman@cod.nosc.mil (Charles H. Sampson)
Subject: Re: Disallowing Pre-Defined Operations
Date: 2000/03/21
Date: 2000-03-21T00:47:31+00:00	[thread overview]
Message-ID: <8b6gr3$5a6$1@newpoisson.nosc.mil> (raw)
In-Reply-To: 8ao2mm$ib7$1@nnrp1.deja.com

In article <8ao2mm$ib7$1@nnrp1.deja.com>,
Robert Dewar  <robert_dewar@my-deja.com> wrote:
>In article <8ang7v$peo$1@newpoisson.nosc.mil>,
>  claveman@fern.com (Charles H. Sampson) wrote:
>> James S. Rogers wrote:
>> >Why not simply declare the type private or limited private,
>then provide
>> >your
>> >own versions for all the required operators?
>>
>>      Because, as I said in my original post, the types are
>inherently
>> numeric and I don't want to lose the ability to use numeric
>literals.
>
>
>Exactly! quite reasonable, and that is why the easy to use
>and understand ABSTRACT feature has been provided to exactly
>meet your needs here.

     But it doesn't exactly meet my needs, Robert.  I don't even think 
it's correct to say that it comes close to meeting my needs.  It does 
come close in the sense that if I try to use an abstract operation, most 
of the time I'll get a close to meaningful error message at compile 
time.  However it fails to exactly meet my needs by a long shot when it 
comes to concept.

     To summarize, I want some way to say that a pre-defined operation 
doesn't exist, that any attempt to write the operation is an error, just 
like attempting to write Float ** Float.  The problem with the ABSTRACT 
approach is that it actually defines the operation, making it exist, but 
declares that it is not callable.  That can give rise to ambiguities, as 
I illustrated in another post in this thread.  For what I want, there 
can't be such ambiguities because one of the two operations that play a 
role when an abstract declaration is used doesn't exist.  I want a 
situation where any user would be as puzzled as I briefly was, where he 
would say, "How can that be ambiguous?  Time_Type - Time_Type can only 
produce a Delta_Time_Type value." 

     For all I know, the abstract approach can cause problems other than 
ambiguities as well.

     The behavior of generics is even further away from what I want.  I 
haven't verified it myself yet, but several people in this thread have 
said that an abstract operation reverts to non-abstract in a generic 
instantiation.  For an operation that has been disallowed, there is 
nothing to revert to.  The programmer has told the compiler that the 
operation has no meaning.  To give it a meaning as a side effect of an 
instantiation makes no sense conceptually. 

     It might be that the units proposal that has been mentioned in this 
thread would satisfy me.  I'm going to try to check it out today.  At 
present, however, Ada is logically deficient and has been since the be-
ginning.  We are allowed to override pre-defined operations for our nu-
meric types, we are allowed to define meanings for operations that have 
no meaning, but we are not allowed to do the last logical step, to say 
that a pre-defined operation has no meaning.

				Charlie

--
******

     For an email response, my user name is "sampson" and my host
is "spawar.navy.mil".




  reply	other threads:[~2000-03-21  0:00 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-10  0:00 Disallowing Pre-Defined Operations Charles H. Sampson
2000-03-09  0:00 ` Keith Thompson
2000-03-09  0:00 ` Samuel T. Harris
2000-03-12  0:00   ` Steven Hovater
2000-03-10  0:00 ` mark_biggar
2000-03-10  0:00 ` Jean-Pierre Rosen
2000-03-11  0:00   ` Tarjei Tj�stheim Jensen
2000-03-11  0:00     ` James S. Rogers
2000-03-13  0:00       ` Tarjei T. Jensen
2000-03-13  0:00     ` dmitry6243
2000-03-13  0:00     ` Robert Dewar
2000-03-13  0:00       ` Keith Thompson
2000-03-15  0:00         ` Robert Dewar
2000-03-15  0:00     ` Charles H. Sampson
2000-03-15  0:00       ` Robert Dewar
2000-03-21  0:00         ` Charles H. Sampson [this message]
2000-03-21  0:00           ` Robert A Duff
2000-03-21  0:00           ` Robert Dewar
2000-03-12  0:00   ` claveman
2000-03-12  0:00     ` Robert A Duff
2000-03-13  0:00       ` Tarjei T. Jensen
2000-03-13  0:00         ` Robert A Duff
2000-03-13  0:00         ` Robert Dewar
2000-03-15  0:00       ` Charles H. Sampson
2000-03-15  0:00         ` Tucker Taft
2000-03-15  0:00           ` Paul Graham
2000-03-16  0:00             ` Robert Dewar
2000-03-16  0:00             ` Charles Hixson
2000-03-17  0:00               ` Paul Graham
2000-03-17  0:00                 ` Charles Hixson
2000-03-18  0:00                   ` Robert Dewar
2000-03-20  0:00                     ` Charles Hixson
2000-03-20  0:00                       ` Robert Dewar
2000-03-16  0:00           ` Bryce Bardin
2000-03-16  0:00           ` Tarjei T. Jensen
2000-03-16  0:00             ` mark_biggar
2000-03-16  0:00             ` Dale Stanbrough
2000-03-17  0:00         ` Robert A Duff
2000-03-13  0:00     ` Ted Dennison
2000-03-14  0:00 ` Nick Roberts
2000-03-15  0:00   ` Robert Dewar
2000-03-17  0:00 ` William A Whitaker
2000-03-18  0:00   ` Robert Dewar
2000-03-22  0:00     ` William A Whitaker
2000-03-23  0:00       ` Robert Dewar
2000-04-06  0:00         ` Robert I. Eachus
2000-04-05  0:00           ` Marin D. Condic
2000-04-06  0:00             ` Robert Dewar
2000-04-06  0:00               ` Marin D. Condic
2000-04-07  0:00                 ` dale
2000-04-07  0:00                   ` Marin D. Condic
2000-04-07  0:00                     ` Tarjei T. Jensen
2000-04-07  0:00                       ` Marin D. Condic
2000-04-07  0:00                         ` tmoran
2000-04-07  0:00                           ` Marin D. Condic
2000-04-08  0:00                             ` Vladimir Olensky
2000-04-08  0:00                             ` Vladimir Olensky
2000-04-08  0:00                         ` Dale Stanbrough
2000-04-10  0:00                         ` Tarjei T. Jensen
2000-04-15  0:00                         ` Niklas Holsti
2000-04-15  0:00                           ` Marin D. Condic
2000-04-07  0:00                 ` Robert Dewar
2000-04-07  0:00                   ` Marin D. Condic
2000-04-09  0:00               ` Robert I. Eachus
2000-03-18  0:00   ` Robert Dewar
2000-03-18  0:00   ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox