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: 103376,3d3f20d31be1c33a X-Google-Attributes: gid103376,public X-Google-Thread: fac41,2c6139ce13be9980 X-Google-Attributes: gidfac41,public From: Roger Browne Subject: Re: Precondition Checking For Ada 0X (Was: Separation of IF and Imp: process issue?) Date: 1997/09/16 Message-ID: <184347314wnr@eiffel.demon.co.uk>#1/1 X-Deja-AN: 273039653 References: <341eac5e.0@news.uni-ulm.de> X-Mail2News-Path: punt-1.mail.demon.net!eiffel.demon.co.uk Reply-To: roger@eiffel.demon.co.uk X-Mail2News-User: roger@eiffel.demon.co.uk X-Broken-Date: Tue, 16 Sep 1997 19:56:19 GMT0BST1 Organization: Everything Eiffel Newsgroups: comp.lang.ada,comp.lang.eiffel Date: 1997-09-16T00:00:00+00:00 List-Id: rodemann@mathematik.uni-ulm.de (Joerg Rodemann) writes: > A short question on the side to our Eiffel friends: are the Eiffel > invariants visible to the client or are the just there to ensure object > state consistency so that it is able to recognize an error condition? > I. e. I assume they may rely on private member variables, don't they? Yes, Eiffel invariants can refer to private attributes and functions. The client doesn't need to examine the invariant directly, because the invariant must be satisfied any time the object is accessible to the client. Eiffel invariants do often refer to their private attributes and functions. For example, a STACK object may have an invariant clause to ensure that "capacity >= count", where 'capacity' is the capacity of some implementation storage (e.g. an array) and 'count' is the number of items currently on the stack. Assuming we are not talking about a BOUNDED_STACK, 'capacity' should be private. Regards, Roger -- -- -- Roger Browne, 6 Bambers Walk, Wesham, PR4 3DG, UK | Ph 01772-687525 -- Everything Eiffel: http://www.eiffel.demon.co.uk/ | +44-1772-687525