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: fac41,953e1a6689d791f6 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,953e1a6689d791f6 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Interfacing contracts (Was: Eiffel and Java + Ada dispatching) Date: 1996/11/17 Message-ID: #1/1 X-Deja-AN: 197101446 references: <6KkYnJwk3RB@herold.franken.de> <56kgrf$61t@fozzie.sun3.iaf.nl> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.eiffel,comp.lang.ada Date: 1996-11-17T00:00:00+00:00 List-Id: In article <56kgrf$61t@fozzie.sun3.iaf.nl>, Geert Bosch wrote: >Example for interface specification that might be accepted by >an Ada implementation without violating the Ada-95 standard (yes?): > > -- Integer square root function truncating the exact result > function Square_Root (I : Natural) return Natural; > > for Square_Root'Post_Condition use > Square_Root (I) ** 2 <= I and (Square_Root (I) + 1) ** 2 > I; Well, 13.1(19) says that expression is evaluated at this point, which is not what you want. You could use specially-formatted comments, as SPARK does. By the way, I think invariants (not loop invariants, but per-class invariants) are the most interesting thing about Eiffel's assertion facility. - Bob