> De : yohg...@gmail.com [mailto:yohg...@gmail.com] De la part de Yasuo
> Ohgaki
>
> Both D and Eiffel evaluates all contracts defined in parents/interfaces.

That's not what I understand about pre-condition inheritance in D (check 
http://ddili.org/ders/d.en/invariant.html#ix_invariant.contract%20inheritance) :

> Upon entering a function, the in blocks are executed automatically from the 
> topmost type to the bottom-most type
> in the hierarchy . If **any in block** succeeds without any assert failure, 
> then the preconditions are considered to be
> fulfilled.

And later :

> Derived types can define in blocks for overridden member functions. 
> Preconditions of a derived type should not be
> stricter than the preconditions of its bases. (Note that not defining an in 
> block means "no precondition at all", which
> may not be the intent of the programmer.)

The D documentation is not clear about interface inheritance, especially 
regarding pre-conditions.

I am OK with the fact that post-conditions and invariants must verify the 
constraints defined in their ancestors (parent classes and interfaces), but, 
for pre-conditions, I would prefer an optional explicit reference to the 
parent's constraints.

Cheers

François


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to