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 11:30:56 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news-FFM2.ecrc.net!news.iks-jena.de!not-for-mail From: Lutz Donnerhacke Newsgroups: comp.lang.ada Subject: Re: Ideas for Ada 200X Date: Wed, 28 May 2003 18:30:55 +0000 (UTC) Organization: IKS GmbH Jena 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: belenus.iks-jena.de X-Trace: branwen.iks-jena.de 1054146655 14822 217.17.192.34 (28 May 2003 18:30:55 GMT) X-Complaints-To: usenet@iks-jena.de NNTP-Posting-Date: Wed, 28 May 2003 18:30:55 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:37932 Date: 2003-05-28T18:30:55+00:00 List-Id: * Robert A Duff wrote: > "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. Approach 1: generic type XT is (<>); procedure Inc(x : in out XT); procedure Inc(x : in out XT) is begin x := XT'Succ(x); end Inc; Approach 2: declare x : XT renames complex.express(ion); begin x := x + 1; end; > 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. Why not 'Succ and 'Pred?