From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c7ea1cb7a2beb2ee X-Google-Attributes: gid103376,public From: claveman@cod.nosc.mil (Charles H. Sampson) Subject: Re: Disallowing Pre-Defined Operations Date: 2000/03/21 Message-ID: <8b6gr3$5a6$1@newpoisson.nosc.mil>#1/1 X-Deja-AN: 600192859 Distribution: world References: <8a9eeg$qtv$1@newpoisson.nosc.mil> <38CA05AF.7E77790D@online.no> <8ang7v$peo$1@newpoisson.nosc.mil> <8ao2mm$ib7$1@nnrp1.deja.com> X-Complaints-To: usenet@newpoisson.nosc.mil X-Trace: newpoisson.nosc.mil 953599651 5446 128.49.4.5 (21 Mar 2000 00:47:31 GMT) Organization: Computer Sciences Corporation NNTP-Posting-Date: 21 Mar 2000 00:47:31 GMT Newsgroups: comp.lang.ada Date: 2000-03-21T00:47:31+00:00 List-Id: In article <8ao2mm$ib7$1@nnrp1.deja.com>, Robert Dewar 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".