Daniel F Moisset wrote:
> So, my question is:
> * Is this a language gotcha? (I found this weird, didn't know about
> it)
See "Iterating Several Actions" by Simon Willcocks (25 April 1995). I
think
your case is analogous, but I have not analysed it precisely.
Also in the comp.lang.eiffel FAQ the answer LISA states:
================================================
LISA: How does the `Iterating several actions' example in ETL work?
The example code page 176 of Eiffel: The Language, 2nd printing does
not work with any widely available compiler. It has confused and
puzzled many newcomers to the language and what it is supposed to
do is not clearly defined in the book.
What the example should do is as follows. When a feature is replicated
under multiple inheritance (renamed so that the feature is now known
under two names) and in the same inheritance clause a routine or
attribute its source text references is also replicated, the routine
body of the first feature should be adapted to call the corresponding
replicated features on each path of the inheritance. The mechanism
is not intended to scale to more complex cases where the replication
does not occur in a single inheritance clause.
This feature is now considered obsolete because agents (see LAGE) are
now available and provide a more convenient solution for this pattern.
================================================
> * Is it a bug of my Eiffel implementation, because precursor
> assertions should not be checked? (it is a bit sad losing assertions
> here)
Perhaps they should be grouped with the child postcondition, and not
evaluated
until then.
> * Is it a bug of my implementation, because calls from Precursor call
> should be made using the Precursor type instead of dynamic type (sound
> very non-OOish, but would make this case work)
Like you, a little uncomfortable with this idea. But a case can be made.
> * Is this a conceptual mistake of mine, the way I am trying to do
> things?
Objects CHILD are not objects PARENT.
--
Peter Horan School of Engineering and Information Technology
peter@[EMAIL PROTECTED]
Deakin University
+61-3-5227 1234 (Voice) Geelong, Victoria 3217, AUSTRALIA
+61-3-5227 2028 (FAX) http://www.eit.deakin.edu.au/~peter
-- The Eiffel guarantee: From specification to implementation
-- (http://www.cetus-links.org/oo_eiffel.html)


|