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,d1df6bc3799debed X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Not intended for use in medical, Date: 1997/05/12 Message-ID: #1/1 X-Deja-AN: 241100002 References: <3.0.32.19970423164855.00746db8@mail.4dcomm.com> <3374C19F.15FE@sprintmail.com> <3375EBA0.777A@sprintmail.com> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-05-12T00:00:00+00:00 List-Id: Robert Duff said <> One thing here is to compare if A > B then longname := A; else longname := B; end if; with longname := longname + 1; and look at the substitutions: longname := x'Max (A,B); x'Incr (longname); note that in either case we are adding the type name to the syntax. It sure looks like the argument for syntactic sugar is far stronger in the Max case than the Incr case, this gets even more so if you consider: Func (X'max (a,b), Y'max (c,d)); where the unsugared version is declare temp1 : x; temp2 : y; begin if a > b then temp1 := a; else temp1 := b; end if; if c > d then temp2 := c; else temp2 := d; end if; Func (temp1, temp2); end; The fact that we do not have a conditional expression form in Ada makes the sweetness of the Max/Min sugar noticable. In Algol-68, we have no max or min, but we can write Func ((a > b | a | b), (c > d | c | d)); which is not too awful, and of course you have a similar notation in C. So this should explain why the argument is bogus (the argument that says "hey, you have Max/Min, so why not Incr/Decr). i