Article View: comp.lang.eiffel
Article #1119Re: [++] Re: Pure OO-What differentiates a true OO from object-based systems
From: Scott Wheeler
Date: Thu, 21 Dec 1995 17:29
Date: Thu, 21 Dec 1995 17:29
35 lines
2303 bytes
2303 bytes
In Article <4ba738$rpq@gaia.ns.utk.edu> Matthew B. Kennel writes: >Scott Wheeler (scottw@bmtech.demon.co.uk) wrote: >:... >: The problem comes in doing it efficiently and cleanly. I'd approach it >: by writing a pre-processor to generate C++ code from an extended >: version of the language. > >: <example deleted>...... > >That missed what I think is the most crucial (and yet simple) part of >Eiffel-style conditions.Namely that a violated precondition points out >a mistake in the CALLER.Therefore, precondition faults should do >something obviously *different* >from generalized assertion violations or invariant or postcondition >faults. Agreed. Up to this point, it is easy to amend the example by using a different macro based on "assert", but containing different text. Of course in existing implementations of C++ one has the source in assert.h. > If some random "assert" goes off, who's fault is that? With >C or C++ and the typical use of "assert" it's hard to say. Was it bad >input data? Was it a mistake in the code? Was it because somebody >else didn't implement the full functionality? Or what? We can rule out bad data by using a specialised version of assert, which will only be used in Eiffel-style invariants and pre- and post-conditions. However it's not obvious how to get a stack trace in the same way as the existing Eiffel implementations without compiler support. It could probably be done, but not efficiently. Any suggestions? Scott
Technical Details
Message-ID:
<jzwdrp@bmtech.demon.co.uk>Path:
arc1-ca.pugleaf.net!mail2news.demon.co.uk!bmtech.demon.co.ukReferences:
<139@feiffel.UUCP> <DJGqqr.M77@cix.compulink.co.uk> <jzuqcm@bmtech.demon.co.uk> <4an3i4$43f@news.irisa.fr> <jzvudu@bmtech.demon.co.uk> <4ba738$rpq@gaia.ns.utk.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!mail2news.demon.co.uk!bmtech.demon.co.uk From: Scott Wheeler <scottw@bmtech.demon.co.uk> Newsgroups: comp.lang.eiffel,comp.lang.c++ Subject: Re: [++] Re: Pure OO-What differentiates a true OO from object-based systems Followup-To: comp.lang.eiffel,comp.lang.c++ Date: Thu, 21 Dec 1995 17:29:04 +0000 Organization: British Maritime Technology Message-ID: <jzwdrp@bmtech.demon.co.uk> References: <139@feiffel.UUCP> <DJGqqr.M77@cix.compulink.co.uk> <jzuqcm@bmtech.demon.co.uk> <4an3i4$43f@news.irisa.fr> <jzvudu@bmtech.demon.co.uk> <4ba738$rpq@gaia.ns.utk.edu> Reply-To: Scott Wheeler <scottw@bmtech.demon.co.uk> X-NNTP-Posting-Host: bmtech.demon.co.uk X-Newsreader: NewsBase v1.36 (Beta) X-Mail2News-Path: relay-4.mail.demon.net!post.demon.co.uk!bmtech.demon.co.uk