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: f891f,9d58048b8113c00f X-Google-Attributes: gidf891f,public X-Google-Thread: 103376,2e71cf22768a124d X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,9d58048b8113c00f X-Google-Attributes: gid1014db,public X-Google-Thread: 101deb,b20bb06b63f6e65,start X-Google-Attributes: gid101deb,public X-Google-Thread: 10cc59,9d58048b8113c00f X-Google-Attributes: gid10cc59,public From: rav@goanna.cs.rmit.EDU.AU (++ robin) Subject: Re: next "big" language?? (disagree) Date: 1996/06/11 Message-ID: <4pj8p7$h9r@goanna.cs.rmit.EDU.AU>#1/1 X-Deja-AN: 159599603 references: <4p1l65$35qi@info4.rus.uni-stuttgart.de> <4p60nk$imd@euas20.eua.ericsson.se> <4p8lmq$oq7@goanna.cs.rmit.edu.au> organization: Comp Sci, RMIT, Melbourne, Australia newsgroups: comp.lang.pascal,comp.lang.c,comp.lang.misc,comp.lang.pl1,comp.lang.ada nntp-posting-user: rav Date: 1996-06-11T00:00:00+00:00 List-Id: ok@goanna.cs.rmit.edu.au (Richard A. O'Keefe) writes: >euahjn@eua.ericsson.se (Henrik Johansson) writes: >>*But* Ada lacks the general >>assertion expression found in other languages like Eiffel (preconditions, >>postconditions, assertions). > subtype Assertion is Boolean range True .. True; > ... > X_Is_Even: Assertion := X mod 2 = 0; >This will raise a constraint exception if the assertion is false. >Looks like an assertion to me. ---What is the point of this? A declaration buried somewhere else, and a test. Why not something in clear english, which doesn't need a reference to some other part of the program, like: if mod(x, 2) ^= 0 then put ('The value of x is not odd.'); This has the aditional benefit that the user of the program has a clear unequivocal message about the cause of the problem. If it's important that the whereabouts of this test be known, the programmer can include a statement such as "signal error;" or "signal condition (xyz);" or "put (' at line ', sourceline );" along with the put statement. [PL/I example]