Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82342 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28587 invoked from network); 10 Feb 2015 07:27:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Feb 2015 07:27:08 -0000 Authentication-Results: pb1.pair.com smtp.mail=pthreads@pthreads.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=pthreads@pthreads.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pthreads.org from 209.85.220.53 cause and error) X-PHP-List-Original-Sender: pthreads@pthreads.org X-Host-Fingerprint: 209.85.220.53 mail-pa0-f53.google.com Received: from [209.85.220.53] ([209.85.220.53:55015] helo=mail-pa0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0B/F9-47508-8C2B9D45 for ; Tue, 10 Feb 2015 02:27:08 -0500 Received: by mail-pa0-f53.google.com with SMTP id lf10so31867629pab.12 for ; Mon, 09 Feb 2015 23:27:02 -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=tHXIyAlBpRVlx/nFwpqLlb4rQ/9S7Z5eTUC5w9t2t1E=; b=VLHufOHUuvet/8/djTgtw66Y2p3vff8YE8YczZSuqj1B9vCvZgXqPY7P9ImZgOFwIE wYTgnLImIoAQMgTQ5gpPLlxWTQdMQvFr7u62k5/olq4JYFQjsbgVVA3qQ/2KZErrD/1A dNVfXjxxqgCe6FHeTa/o1j8a4J3QXohWDbSgFk7afqatgk/ZmUp2v/84g7gA9Mvq/3ZE RBlOE/LBdf+WZRytpQmaOKM0xf6yEyMXFHwknSwJCFLkEbs8ms+3xyniIzah2EQLJk3z ikYHe9XsObbYqqZeUPrqrz7yTDwe6FYeJBUqNel5LylVjcmQpcQQnh1M4zn9NtflGgIY RidA== X-Gm-Message-State: ALoCoQnSsEVFwOlCEGhtQg+rTgNar4OD0CvmRESKkR84T+EYL3HURxs11Yxmj4UnX5y8rZlIoJtg MIME-Version: 1.0 X-Received: by 10.70.90.6 with SMTP id bs6mr35092741pdb.128.1423553222246; Mon, 09 Feb 2015 23:27:02 -0800 (PST) Received: by 10.70.49.100 with HTTP; Mon, 9 Feb 2015 23:27:02 -0800 (PST) X-Originating-IP: [109.145.22.92] In-Reply-To: References: <54D7ED22.3080001@gmail.com> Date: Tue, 10 Feb 2015 07:27:02 +0000 Message-ID: To: Yasuo Ohgaki Cc: Dmitry Stogov , PHP Internals , Stanislav Malyshev Content-Type: multipart/alternative; boundary=001a11c222ea219882050eb6d00f Subject: Re: [PHP-DEV] Design by Contract From: pthreads@pthreads.org (Joe Watkins) --001a11c222ea219882050eb6d00f Content-Type: text/plain; charset=UTF-8 > One reason I would like to use __invariant() is to allow overriding parents. Well, another approach would be optionally named contracts: class Some { require contractName (invariant-expr); /* ... */ } This would also improve default error messages as a by-product. Cheers Joe On Tue, Feb 10, 2015 at 7:06 AM, Yasuo Ohgaki wrote: > Hi Joe, > > On Tue, Feb 10, 2015 at 3:59 PM, Joe Watkins > wrote: > >> I'm not sure we can always enforce invariant contracts ... >> >> Evaluating invariant expressions on entry and exit is not enough, since a >> property can be changed without the use of a method. >> >> Can or should, we do anything about that ? >> >> This should also be covered in the RFC, I think. >> > > One reason I would like to use __invariant() is to allow overriding > parents. > I think we should have way for it, but I don't have good idea now. > I'm still thinking. > > Regards, > > -- > Yasuo Ohgaki > yohgaki@ohgaki.net > --001a11c222ea219882050eb6d00f--