Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82431 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40380 invoked from network); 11 Feb 2015 07:18:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Feb 2015 07:18:30 -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.192.176 cause and error) X-PHP-List-Original-Sender: pthreads@pthreads.org X-Host-Fingerprint: 209.85.192.176 mail-pd0-f176.google.com Received: from [209.85.192.176] ([209.85.192.176:42694] helo=mail-pd0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EC/E7-33902-4420BD45 for ; Wed, 11 Feb 2015 02:18:29 -0500 Received: by pdbfp1 with SMTP id fp1so2593396pdb.9 for ; Tue, 10 Feb 2015 23:18:26 -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=HU3HMPUmnUguqPAKEMPREa/uYNYGb2XYCnlhUkv7whU=; b=jYim20nlSzMpKN7DxYKyhWDkw41zzDDtAs2A4ut1+IKnnhtFOnu50/9i37394BaIQf YhuKXeeqAxaui4k+Tvp9dIwjcL9KwhYZyIXoeLiOO/4y4tWJtYndw5LXAwJLM+EWkfcA yMa0YsmhD2chEpks1hhLMbsojWpXcSN+6Oqp2JduyT1deM2PAfUT7XXvHdMfAFcwEoF1 oHsNqUfSRsrcTnHf6r0VTl6V+4NVavYOfVvPU0c/vSzM0cULB4+iFLF60LiCtKzXyDFk C3qD/I+qnwFKrh63SVgGsqto8PHQshpqkRBSLUalfeDuRiAMBsPIL14ylq9uu1lfz1tO 30CQ== X-Gm-Message-State: ALoCoQlVT0pfajokTnQS4XI0ye49mA/KrgB0MEcGVNqyg9CQMRDod1FORE4lkDVIFfM4FsWmwuR+ MIME-Version: 1.0 X-Received: by 10.68.106.226 with SMTP id gx2mr44630282pbb.78.1423639105985; Tue, 10 Feb 2015 23:18:25 -0800 (PST) Received: by 10.70.49.100 with HTTP; Tue, 10 Feb 2015 23:18:25 -0800 (PST) X-Originating-IP: [109.145.22.92] In-Reply-To: References: <54D7ED22.3080001@gmail.com> Date: Wed, 11 Feb 2015 07:18:25 +0000 Message-ID: To: Yasuo Ohgaki Cc: Dmitry Stogov , Patrick Schaaf , internals Content-Type: multipart/alternative; boundary=047d7b6da9f0338c87050ecacff5 Subject: Re: [PHP-DEV] Design by Contract From: pthreads@pthreads.org (Joe Watkins) --047d7b6da9f0338c87050ecacff5 Content-Type: text/plain; charset=UTF-8 > If there is no technical difficulties, I would like to have it. Okay then, I'll rethink ... Cheers Joe On Wed, Feb 11, 2015 at 7:12 AM, Yasuo Ohgaki wrote: > 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 > --047d7b6da9f0338c87050ecacff5--