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: 10cc59,9d58048b8113c00f X-Google-Attributes: gid10cc59,public X-Google-Thread: 101deb,b20bb06b63f6e65 X-Google-Attributes: gid101deb,public From: ag129@ucs.cam.ac.uk (A. Grant) Subject: Re: next "big" language?? (disagree) Date: 1996/06/11 Message-ID: #1/1 X-Deja-AN: 159599606 references: <4p1l65$35qi@info4.rus.uni-stuttgart.de> <4p60nk$imd@euas20.eua.ericsson.se> <4p8lmq$oq7@goanna.cs.rmit.edu.au> <4pj8p7$h9r@goanna.cs.rmit.EDU.AU> organization: University of Cambridge newsgroups: comp.lang.pascal,comp.lang.c,comp.lang.misc,comp.lang.pl1,comp.lang.ada Date: 1996-06-11T00:00:00+00:00 List-Id: In article <4pj8p7$h9r@goanna.cs.rmit.EDU.AU> rav@goanna.cs.rmit.EDU.AU (++ robin) writes: > >euahjn@eua.ericsson.se (Henrik Johansson) writes: > >>assertion expression found in other languages like Eiffel ( preconditions,> >>postconditions, assertions). >---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.'); The point of assertions is not to print messages for the programmer. You can use them to allow the compiler to optimise safely, provide a contractual interface between modules, and for preconditions, postconditions, loop invariants etc. when proving the correctness of programs. E.g. the assertion that X is odd could form part of the declared interface to a module whose implementation was hidden.