> I think we should just repeat the related D semantic. I'm not sure it all fits, some decisions were likely taken because of D's object model.
I'm going to continue research today and will be updating the RFC, I'll aim for as close to D as possible then. Cheers Joe On Wed, Feb 11, 2015 at 7:26 AM, Dmitry Stogov <dmi...@zend.com> wrote: > I think we should just repeat the related D semantic. > It must be defined in contracts inheritance rules. > > What if we have contracts for prototype method in parent class and > interface? > Should we still validate contracts of parent and interface if we add our > owns? > etc. > > Thanks. Dmitry. > > On Wed, Feb 11, 2015 at 10:08 AM, Joe Watkins <pthre...@pthreads.org> > wrote: > >> D has them: >> >> http://dlang.org/interface.html#interface-contracts >> >> Maybe we could allow pre/post contracts but invariants don't make sense >> on interfaces. >> >> The question is, do we want to make them always available when possible, >> or do we want to make them available where it seems most useful and or >> least complex ? >> >> I prefer the latter, everyone else ? >> >> Cheers >> Joe >> >> On Wed, Feb 11, 2015 at 7:02 AM, Dmitry Stogov <dmi...@zend.com> wrote: >> >>> I think we can't support contracts on interfaces and abstract methods. >>> How D works? >>> >>> Thanks. Dmitry. >>> >>> On Wed, Feb 11, 2015 at 1:56 AM, Yasuo Ohgaki <yohg...@ohgaki.net> >>> wrote: >>> >>>> Hi Dmitry and Joe, >>>> >>>> On Wed, Feb 11, 2015 at 6:29 AM, Yasuo Ohgaki <yohg...@ohgaki.net> >>>> wrote: >>>> >>>>> On Tue, Feb 10, 2015 at 8:53 PM, Dmitry Stogov <dmi...@zend.com> >>>>> wrote: >>>>> >>>>>> You are welcome to edit https://wiki.php.net/rfc/dbc2 >>>>>> It looks like we have similar views, so just make it better in a way >>>>>> you think. >>>>>> >>>>> >>>>> Looks good to me. It's much better than original. Thank you folks. >>>>> We have related issue like how internal module incorporate with DbC. >>>>> However >>>>> these could be future issues. >>>>> >>>> >>>> A little more clarification, following interface definition is allowed >>>> or not? >>>> >>>> interface Some { >>>> >>>> require($this->last_result > 1000); // Force classes to have >>>> $this->result >>>> >>>> function bar($a, $b) >>>> require($a > $b) >>>> return($ret, $ret > 1000); >>>> >>>> function getLastResult() >>>> return($ret, $this->last_result === $ret); >>>> >>>> } >>>> >>>> I suppose it is supported, but it may be better to be explicit. >>>> >>>> Regards, >>>> >>>> -- >>>> Yasuo Ohgaki >>>> yohg...@ohgaki.net >>>> >>> >>> >> >