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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,38fc011071df5a27 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-28 10:38:15 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!nntp-relay.ihug.net!ihug.co.nz!falcon.america.net!uunet!dca.uu.net!ash.uu.net!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Ideas for Ada 200X Date: 28 May 2003 13:38:11 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <6a90b886.0305262344.1d558079@posting.google.com> <3ED41344.7090105@spam.com> <3ED46D81.FF62C34F@0.0> <3ED46E07.4340CABC@0.0> <3ED4F3FD.A0EF7079@alfred-hilscher.de> <3ED4ECFC.5060000@cogeco.ca> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1054143491 31564 199.172.62.241 (28 May 2003 17:38:11 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Wed, 28 May 2003 17:38:11 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:37923 Date: 2003-05-28T13:38:11-04:00 List-Id: "Warren W. Gay VE3WWG" writes: > I disagree that it is "urgent". What is your case for urgency here? > From what I have seen, most people that promote the idea, are just > "typing challenged" (yes I know ++i is different than i++). Well, I like the idea of an increment operation, and my reasoning has nothing to do with typing. The problem is code duplication: you have to write "I" twice in "I := I + 1;". No big deal if it's just "I", but it could be a complicated name, so the reader has to careful compare the text, and also worry about whether the name has side effects. > Consider this: the Ada95 language is already large and complex. Is > there really enough justification for complicating it with ++i/i++ > issues? Not to meantion that --i may appear like a comment?!?!? ;-) Of course, if Ada had such a thing, it shouldn't be called "--". If I were the boss, it would be called Incr and Decr. They would be procedures, not functions, because I don't like to encourage that sort of side effect in the middle of expressions. So in that regard, it would be different from C's ++ and --. There's no pre-increment vs. post-increment issue. Note that an earlier version of Ada 9X allowed untagged class-wide types. That feature, plus giving a true name to root_integer, would have allowed such things to be written *in the language*: procedure Incr(X: in out Root_Integer'Class; By: Root_Integer'Class); Incr(A[I].X); Incr(A[I].X, By => 2); Of course, you can define such a procedure in Ada 95, but you have to do it for every integer type, and it's just not worth the trouble. If you could do it once, for all integer types, it would be worth it. - Bob