Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82441 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52592 invoked from network); 11 Feb 2015 07:32:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Feb 2015 07:32:19 -0000 Authentication-Results: pb1.pair.com header.from=pthreads@pthreads.org; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=pthreads@pthreads.org; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pthreads.org from 209.85.192.169 cause and error) X-PHP-List-Original-Sender: pthreads@pthreads.org X-Host-Fingerprint: 209.85.192.169 mail-pd0-f169.google.com Received: from [209.85.192.169] ([209.85.192.169:36254] helo=mail-pd0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 51/BA-33902-2850BD45 for ; Wed, 11 Feb 2015 02:32:19 -0500 Received: by pdjp10 with SMTP id p10so2716052pdj.3 for ; Tue, 10 Feb 2015 23:32:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=ZLKi4moXltzaCjxh/ZPFAv2zzeogFTT0/HIyXVB6Zho=; b=CQRAm/sQ64JZm14rjYz3hJJu3T6TH3TkAb146sfnthAW9IkuOlcU0aiiA4bx3M+8DP r5O1jKSmVoJGnlO3vzODtbVGS8vnMvjtjIovF6Kts6ZFqmAAVf6FnhXNtgtzh2KzU3WF NkxoAIV5ETp/AG5eQHmJq5U6WXL3vnFwinXNTWykvjeffbuLbNRPRgWg8ronEXWwX+sp WMnk0DkW28FNQh7TkOGaYuAnhc86cocSEri+rkCadAsN6eskwtV/dApxIMFgIPwYCTCW YltpAIJQVlidzuLO0EcFYYPzxvtfw9kdVKXgEiCDtZa0nPy53Cfuef4OlPRYHU/H8701 kOaQ== X-Gm-Message-State: ALoCoQkLwsTqMIoWl+NQ7Oit56/ZOLZNJRqRX09y9jUojnh+7Xnq8Pe+a+FOvkq99fCMPTok9SbJ MIME-Version: 1.0 X-Received: by 10.66.146.168 with SMTP id td8mr43871994pab.20.1423639935379; Tue, 10 Feb 2015 23:32:15 -0800 (PST) Received: by 10.70.49.100 with HTTP; Tue, 10 Feb 2015 23:32:15 -0800 (PST) X-Originating-IP: [109.145.22.92] In-Reply-To: References: <54D7ED22.3080001@gmail.com> Date: Wed, 11 Feb 2015 07:32:15 +0000 Message-ID: To: Dmitry Stogov Cc: Yasuo Ohgaki , Patrick Schaaf , internals Content-Type: multipart/alternative; boundary=047d7b677884a30247050ecb00b2 Subject: Re: [PHP-DEV] Design by Contract From: pthreads@pthreads.org (Joe Watkins) --047d7b677884a30247050ecb00b2 Content-Type: text/plain; charset=UTF-8 > 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 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 > 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 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 >>> wrote: >>> >>>> Hi Dmitry and Joe, >>>> >>>> On Wed, Feb 11, 2015 at 6:29 AM, Yasuo Ohgaki >>>> wrote: >>>> >>>>> On Tue, Feb 10, 2015 at 8:53 PM, Dmitry Stogov >>>>> 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 >>>> yohgaki@ohgaki.net >>>> >>> >>> >> > --047d7b677884a30247050ecb00b2--