Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82429 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37099 invoked from network); 11 Feb 2015 07:12:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Feb 2015 07:12:48 -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.171 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.216.171 mail-qc0-f171.google.com Received: from [209.85.216.171] ([209.85.216.171:36687] helo=mail-qc0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id ED/37-33902-FE00BD45 for ; Wed, 11 Feb 2015 02:12:47 -0500 Received: by mail-qc0-f171.google.com with SMTP id l6so1462558qcy.2 for ; Tue, 10 Feb 2015 23:12:44 -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=UKwh3DOrAdyWwdJFmCxDVEclhWunkI86+P3wWsDApv4=; b=St+bv0+CvZ8rSg5nb7mSlw2sto+Cu5iSMrc/rqHi5Dl2gokTqa2ycNuPI3/5gm7f+k BsmS8aP+TNx4T1SJ59HcRAkEhLWaeDvjtBAzL7AzptvfKgvVGYIA9JeDawpncftAFuP6 pD+hBPSJBqxJzFwm+7LH5TEw6S1TNOpeC+cza8baOM09TLF+ZsBbE4xbl4XXVEiP8aVj TEf9z6c6yX98QJLeM1Uem6TMlue5zSmfUnZMXdqEJKaZP6yv6pit8Xfmq0/WA/l+YlYi SsWIiFbwSs8R4vHKdd2i9Xjmkn+Qt43i5L/DGTnbAVQaYxPle1YPwRBDFUD7S5tujtQF ZYTg== X-Received: by 10.224.119.199 with SMTP id a7mr46876377qar.68.1423638764707; Tue, 10 Feb 2015 23:12:44 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.229.250.195 with HTTP; Tue, 10 Feb 2015 23:12:04 -0800 (PST) In-Reply-To: References: <54D7ED22.3080001@gmail.com> Date: Wed, 11 Feb 2015 16:12:04 +0900 X-Google-Sender-Auth: itU_-i3VHIjihXGxjTgl4nlsRNw Message-ID: To: Dmitry Stogov Cc: Joe Watkins , Patrick Schaaf , internals Content-Type: multipart/alternative; boundary=001a11c2f9b4dbe443050ecabaa2 Subject: Re: [PHP-DEV] Design by Contract From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11c2f9b4dbe443050ecabaa2 Content-Type: text/plain; charset=UTF-8 Hi Dmitry and Joe, On Wed, Feb 11, 2015 at 4:02 PM, Dmitry Stogov wrote: > I think we can't support contracts on interfaces and abstract methods. > How D works? D supports contract in structure and interface. Structure is more like classes in D, though. interface I { int foo(int i) in { assert(i > 7); } out (result) { assert(result & 1); } void bar(); } http://dlang.org/interface.html Eiffel support contracts for interfaces. class interface DICTIONARY [ELEMENT] feature put (x: ELEMENT; key: STRING) is -- Insert x so that it will be retrievable -- through key. require count <= capacity not key.empty ensure has (x) item (key) = x count = old count + 1 ... Interface specifications of other features ... invariant 0 <= count count <= capacity end -- class interface DICTIONARY https://archive.eiffel.com/doc/manuals/technology/contract/ If there is no technical difficulties, I would like to have it. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11c2f9b4dbe443050ecabaa2--