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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,c52c30d32b866eae X-Google-Attributes: gidfac41,public X-Google-Thread: 1108a1,c52c30d32b866eae X-Google-Attributes: gid1108a1,public X-Google-Thread: 103376,2ea02452876a15e1 X-Google-Attributes: gid103376,public From: Roger Browne Subject: Re: Real OO Date: 1996/05/14 Message-ID: <668349999wnr@eiffel.demon.co.uk>#1/1 X-Deja-AN: 154754791 x-nntp-posting-host: eiffel.demon.co.uk references: x-broken-date: Tue, 14 May 1996 08:32:47 GMT0BST1 x-mail2news-path: disperse.demon.co.uk!post.demon.co.uk!eiffel.demon.co.uk organization: Everything Eiffel reply-to: roger@eiffel.demon.co.uk newsgroups: comp.lang.eiffel,comp.lang.ada,comp.object Date: 1996-05-14T00:00:00+00:00 List-Id: Tucker Taft writes: > The simplest solution might be to distinguish whether a given > assertion should apply only on a specific type/class, or should > apply on all descendant types/classes as well... This is trivial in Eiffel. Just include an assertion clause that is a call to a boolean-valued function that can be redefined in descendants. For example: class X feature ... local_invariant: BOOLEAN is do ... end invariant enforced_on_descendants: some_boolean_valued_expression redefinable_in_descendants: local_invariant end Feature 'local_invariant' can be strengthened or weakened in descendants, whereas 'some_boolean_valued_expression' can only be strengthened in descendants (by being implicitly "and"-ed with the invariant of the descendant). Regards, Roger -- -- -- Roger Browne, 6 Bambers Walk, Wesham, PR4 3DG, UK | Ph 01772-687525 -- Everything Eiffel: compilers/libraries/publications | +44-1772-687525