Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82667 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65396 invoked from network); 14 Feb 2015 04:16:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Feb 2015 04:16:28 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.182 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.216.182 mail-qc0-f182.google.com Received: from [209.85.216.182] ([209.85.216.182:55790] helo=mail-qc0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B3/D8-15073-B1CCED45 for ; Fri, 13 Feb 2015 23:16:28 -0500 Received: by mail-qc0-f182.google.com with SMTP id r5so3530784qcx.13 for ; Fri, 13 Feb 2015 20:16:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=CGP16hvVz2DTrDQmRwGc/NMyYOEp0EaRmiTYgA6G3G4=; b=iUCP4eI8ZM5rn1OoSG376vqICGAv7U4zXsIdW0TavXN4E0yEEiMV74fMoh3llGYKi/ /+eqhssVBFtGfKOBKYu1feMPHM4IOmCu49uN+4cMaorrLM0lme33Yo2271/wVivyyjtT GH/yyKu8y3P9KCO+8oJU4YNPnlbMSH2NMkw1vNl5Kw6Tn39wSdkEp9ElPYeG1w5TZz6Q AvlxvtBIZMrQzzEruvXT/t2Am5ZWP1GHPAJqFNOHJX751RXy6EMfvmHq7OdVwNlrMCaG k08EvlDldcMxo6vjD8IhWwlCiAwv6Jz+ECOSax6RBiJ8UFer4DoiMCpvuimdKKrXQro3 a3Dg== X-Received: by 10.140.151.13 with SMTP id 13mr2815525qhx.68.1423887385490; Fri, 13 Feb 2015 20:16:25 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.229.198.8 with HTTP; Fri, 13 Feb 2015 20:15:44 -0800 (PST) In-Reply-To: References: <54DAFD32.3000005@gmail.com> <54DB0BC0.20304@gmail.com> <54DBA801.8060403@gmail.com> <011e01d04802$cbd78ce0$6386a6a0$@php.net> Date: Sat, 14 Feb 2015 13:15:44 +0900 X-Google-Sender-Auth: fDsxc4FYyxx6hAyT7Mm-MWXxUak Message-ID: To: francois Cc: Dmitry Stogov , Joe Watkins , Stanislav Malyshev , PHP Internals Content-Type: multipart/alternative; boundary=001a113553f2cffa50050f049dd3 Subject: Re: [PHP-DEV] Design by Contract From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a113553f2cffa50050f049dd3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Francois, On Sat, Feb 14, 2015 at 12:53 PM, Yasuo Ohgaki wrote: > On Sat, Feb 14, 2015 at 12:03 PM, Fran=C3=A7ois Laupretre > wrote: > >> > For method calls, overridden method should not evaluate parents >> contract on entry. >> > It should be evaluated when parent method is called. >> >> I already told you : the logic you are using for pre-conditions is NOT >> compatible with Eiffel and D logic, although this is what you're suppose= d >> to mimic. It is actually the opposite. Is it a wanted behavior ? because >> you should be aware that it does not respect the LS principle. > > > Did you mean "Least Concern Principle" here? I'm lost here. Eiffel does not even allow method overriding. Therefore, child class's method contract will never evaluated unless it is explicitly called. Semantics is basically the same as what I wrote. (Eiffel requires to drop parent method by "redefine" or rename parent method by "rename" when the same method name is needed) I agree that Eiffel's approach is stricter with respect to least concern principle. It's just not suitable for PHP, is it? Similar argument can be done for D's invariant. D dropped invariant from class in favor of immutables. Immutable is better for least concern, but we don't have immutables now. Even if we have it, people would like to manage object state. We may have both. Anyway, could you explain what kind of issues we may have? Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a113553f2cffa50050f049dd3--