Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82440 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52507 invoked from network); 11 Feb 2015 07:32:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Feb 2015 07:32:16 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.170 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.170 mail-vc0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:62574] helo=mail-vc0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3D/AA-33902-0850BD45 for ; Wed, 11 Feb 2015 02:32:16 -0500 Received: by mail-vc0-f170.google.com with SMTP id hq12so632846vcb.1 for ; Tue, 10 Feb 2015 23:32:12 -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=K7609fSVXItZHnCzyk46JTNVHoS5jOpzCkzS72zbySY=; b=T7NhVtFjkwzHrn0tyKTFT+HX+cit3aUCDxFIJe6K8RTJktNHXOLAzsjf3Zz+YOJqge eCkt/a2Gw4YLB+/6MZlTeizi5T1x/SgSH0+qn9uNJW/+tucDSdy9erkRAXLMsbozzh1Y NevUETY68DEK7iJIKcFoSIcXjqJgIka9+N3FHfnfVIvVMZcqZqfBeRWPRqxqO82uIqEy OAy0boJGW/0Gr71+SA0UjMQD+tuOvGE3ON2MOR3WrGYMg7pL6O/KREfnqUWeyPsZwKke XTOARt3lI/7QH8fyt82lrUH2tq4QB3MWyahPw83JGoZR5SZkTffCH8us9R6LA9JdJ3/Y Ficg== X-Gm-Message-State: ALoCoQkpoq9AMzFvUCyzkaxP4ghfL3sCpfHYleVW2f1ZRxd4IpH9WORAJDbSkoKC52T0/2MMf0bnAs4mFqFKqrlx0VNUXUwThfDppdE7DStQ4Yj1uCvzoM2Ghzo8Zy0+p1PFoKtZOb1VOzjaWAOGOhRTEq+/tk70zA== MIME-Version: 1.0 X-Received: by 10.221.44.65 with SMTP id uf1mr18039004vcb.46.1423639931874; Tue, 10 Feb 2015 23:32:11 -0800 (PST) Received: by 10.52.74.73 with HTTP; Tue, 10 Feb 2015 23:32:11 -0800 (PST) In-Reply-To: References: <54D7ED22.3080001@gmail.com> Date: Wed, 11 Feb 2015 11:32:11 +0400 Message-ID: To: Yasuo Ohgaki Cc: Joe Watkins , Patrick Schaaf , internals Content-Type: multipart/alternative; boundary=001a11c3ea3c6d842a050ecb0088 Subject: Re: [PHP-DEV] Design by Contract From: dmitry@zend.com (Dmitry Stogov) --001a11c3ea3c6d842a050ecb0088 Content-Type: text/plain; charset=UTF-8 So, I think we have to support them as well. On Wed, Feb 11, 2015 at 10: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 > --001a11c3ea3c6d842a050ecb0088--