Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81946 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31429 invoked from network); 5 Feb 2015 16:44:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Feb 2015 16:44:05 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.171 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.171 mail-vc0-f171.google.com Received: from [209.85.220.171] ([209.85.220.171:54301] helo=mail-vc0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 93/B4-27691-5DD93D45 for ; Thu, 05 Feb 2015 11:44:05 -0500 Received: by mail-vc0-f171.google.com with SMTP id hq12so854421vcb.2 for ; Thu, 05 Feb 2015 08:44: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=FJdPblAi3LxiVlnJYDgDNkBusI8iBHqCFwmwwMG/tRs=; b=OEqE4A6ioMvQDUVBuCdIDHKFebZ57VT1rjb4KTNdcTkqs0KxwzyO3W2ubrqkat/BV3 CqWjpdvzZpXdTszXDIhD/rOfFKP9rJpslO+od9ASbbBlqJ9jxvhKHgIjGb6u+iOUKr90 46iCOUnQQ2AeSviLzy2+4gH2I9/Sgb4mAxvspykDWQOaMdNpwi0lm/YKFmZ/kHqYFYhE h81HuyVRZR99oYQ7Pnk1WxKWyyOL9ZTRpip8ZVF0vsHGj9EClnqXFg+V9fbOXvkunNXg SBFx17CldtLJmPQb2u/RPFUiFzf1ZKHWF8KWguTmogP6xav71EkQOy2bH69aW204cDh7 enxw== X-Gm-Message-State: ALoCoQn3HK/cKJxANsIrIr1x41frVdG1b566fKVWDVzzejvD8u0wyFlYzCbCoEYBaJ3DFVdBf8fuI71/Mj4r3VUy0ynRr2W7Vasnm+8le1KTCKpt1xiEWv+ui8/WpJW2m8mh0q10XCw90dGEVPqltQ/MEd6Yp6zqOw== MIME-Version: 1.0 X-Received: by 10.52.52.136 with SMTP id t8mr2314369vdo.49.1423154642754; Thu, 05 Feb 2015 08:44:02 -0800 (PST) Received: by 10.52.74.73 with HTTP; Thu, 5 Feb 2015 08:44:02 -0800 (PST) In-Reply-To: <023201d0415e$5731d800$05958800$@tekwire.net> References: <01d601d04146$6fbda4c0$4f38ee40$@tekwire.net> <020c01d0414b$2c3a1120$84ae3360$@tekwire.net> <023201d0415e$5731d800$05958800$@tekwire.net> Date: Thu, 5 Feb 2015 20:44:02 +0400 Message-ID: To: =?UTF-8?Q?Fran=C3=A7ois_Laupretre?= Cc: Yasuo Ohgaki , Pierre Joye , PHP internals Content-Type: multipart/alternative; boundary=089e0115f048f132fc050e5a02bb Subject: Re: [PHP-DEV] Design by Contract From: dmitry@zend.com (Dmitry Stogov) --089e0115f048f132fc050e5a02bb Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable This is just a brainstorming, and we are not going to provide a working solution tomorrow :) You have enough time :) I don't like phpdoc approach because we have to define, parse and compile new syntax for constraints. Would constraint be able to call other functions? include external php files? etc? For me it's an overhead. We may reuse PHP syntax. Thanks. Dmitry. On Thu, Feb 5, 2015 at 7:11 PM, Fran=C3=A7ois Laupretre wrote: > > De : yohgaki@gmail.com [mailto:yohgaki@gmail.com] De la part de Yasuo > Ohgaki > > > We don't have to integrate DbC into phpdoc. phpdoc may have integration > of new DbC syntax. > > I think it's helpful even if phpdoc copies post/pre condition as > document. > > > > There are too many possibility for DbC syntax. > > We are better to choose something in common among languages. > > No. The more I detail the concept, the more I read alternative proposals, > the more I consider extending phpdoc is the best solution. As I explain i= n > the RFC, both concepts are closely related, and that's the only solution > I've seen so far that preserves BC. I could add that it proposes a soluti= on > to issues not even detected nor discussed in alternative proposals, like > the syntax for return value, separate check for arguments returned by ref= , > built-in type checks, etc. Before we choose an alternative syntax, I thin= k > we should have good reasons, not 'Hey, that's how it's done in D !'. If > there's a good reason to copy D or Eiffel syntax, let's adopt it, but I > haven't read any good reason so far. And D is not so widely used so there= 's > no user habit. We can copy the concept without copying the syntax. > > I think we're going too fast here. Before giving up and switching to > another syntax, can you give me a little time to present what I have in > mind. I started writing it yesterday evening and it will be ready tomorro= w > morning (UTC). Then, we can make a decision. > > Cheers > > Fran=C3=A7ois > > > > --089e0115f048f132fc050e5a02bb--