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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d1df6bc3799debed X-Google-Attributes: gid103376,public From: "John G. Volan" Subject: Re: Not intended for use in medical, Date: 1997/05/08 Message-ID: <33727FA5.5C7A@sprintmail.com>#1/1 X-Deja-AN: 240325159 References: <3.0.32.19970423164855.00746db8@mail.4dcomm.com> <5kl9qc$g4d@bcrkh13.bnr.ca> <5kmek2$9re@bcrkh13.bnr.ca> Reply-To: johnvolan@sprintmail.com Newsgroups: comp.lang.ada Date: 1997-05-08T00:00:00+00:00 List-Id: Robert Dewar wrote: > > Robert Duff said > > < having short-hand notations like "++" and "+=".>> > > There is something potentially wrong, which is that compact operation > notations like this are most happy with short identifier names, as in > > a++; > > not nearly so pretty is > > Average_Daily_Rate_Of_Pay++; > > and indeed if you speak the above, it comes out as a joke, people laugh. That's why I've suggested before that an Ada analog to "++" could have been rendered as a procedure attribute: Money_Type'Increment (Average_Daily_Rate_Of_Pay); Far less error prone than: Average_Daily_Rate_Of_Pay := Average_Weekly_Rate_Of_Pay + 1; -- Oops! Ah, if only ... :-) I mean, if T'Min and T'Max could make it into Ada95, then why not: procedure T'Increment (X : in out T); -- ++ analog procedure T'Decrement (X : in out T); -- -- analog procedure T'Increase (X : in out T; By : in T); -- += analog procedure T'Decrease (X : in out T; By : in T); -- -= analog procedure T'Multiply (X : in out T; By : in T); -- *= analog procedure T'Divide (X : in out T; By : in T); -- /= analog Yes, I know these can all be done with ordinary procedures and generics, and I know there's a limit to what you can cram into a language specification. But in this case, I think it would have been politically savvy to have included something like these attributes, as an answer to the challenge from C++'s operators. Well, we've been down this road before. What was that about "wishes and fishes" ...? :-) ------------------------------------------------------------------------ Internet.Usenet.Put_Signature (Name => "John G. Volan", Home_Email => "johnvolan@sprintmail.com", Slogan => "Ada95: The World's *FIRST* International-Standard OOPL", Disclaimer => "These opinions were never defined, so using them " & "would be erroneous...or is that just nondeterministic now? :-) "); ------------------------------------------------------------------------