> De : yohg...@gmail.com [mailto:yohg...@gmail.com] De la part de Yasuo Ohgaki
>
> D resolves that if parameter is contract or not at compile time and checks it 
> if method
> is overriding parent's method. If method is overridden, D just ignores 
> contract.

That's true for pre-conditions, but that's not the way D handles 
post-conditions.

>>> The same rule for class applies to interfaces.
>>
>> ?? I don't understand.
>
>Interface may have contracts just like class.

OK, but when do you check interface conditions ? And how do you deal with 
interface (multiple) inheritance ?

>>> We cannot ignore parent class invariants. If developer violate parent
>>> property restrictions,
>>> it's violation of parent class type and this must be forbidden. It's
>>> checked by invariant contract.
>>
>> I agree.
>
> We have(had) weak type system. Choosing right type system for PHP would be 
> very hard.
> I didn't intended to bring this topic... Could we introduce simple "Design by 
> Contract"
> concept?  Or are we going to discuss right type system for PHP?

Sure, but are you realizing that you're discarding your own statement, not mine 
?

I never told about the PHP type system because I don't understand what types 
have to do here. So, yes, I don't care about the PHP type system and that's not 
the subject. We are discussing about PHP conditions and when they are 
evaluated, that's all.

And, sorry about that, but could you stop sending html messages ? It makes 
replies much harder.

Regards

François



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

Reply via email to