Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82458 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82311 invoked from network); 11 Feb 2015 08:29:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Feb 2015 08:29:19 -0000 Authentication-Results: pb1.pair.com header.from=pthreads@pthreads.org; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=pthreads@pthreads.org; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pthreads.org from 209.85.220.42 cause and error) X-PHP-List-Original-Sender: pthreads@pthreads.org X-Host-Fingerprint: 209.85.220.42 mail-pa0-f42.google.com Received: from [209.85.220.42] ([209.85.220.42:45896] helo=mail-pa0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1E/31-33902-BD21BD45 for ; Wed, 11 Feb 2015 03:29:16 -0500 Received: by mail-pa0-f42.google.com with SMTP id rd3so2605415pab.1 for ; Wed, 11 Feb 2015 00:29: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=y1tEAsP+vOsbdtz3VorCTDcT/uVUiewzc4tpa+3+UxA=; b=d9nW6OO+9Ph1dxZV6NTHyIfXUICrlIgYezMo+IxReeM5PVUJZh6BUF50iJ9X75TCl4 3sO4Dpy0R/vn+DCLn97ZsDk9ZsgNSjkuwEN2fwtvWuePE6+j9zEhZbKgQ1NMH8Vhv7FH NGGGMmmkp9uYfCk97aMhXxzaw2DzRpScq48tCt2mbmH2TbaS5BLWTbBkoNB58T/C+zuZ cPOhNWv0z3C8bOhlxjWp8ErcHkjhRHWWeKQKn8bitJkRrXmy4WIfgamH4seIE7/ljDLB J9Tyn8g5CeEFQF7rh/dgq2LUxpx0MIYH/eMKOCMMa36KhojsgHF+auHEW86GMkq5lUhZ /+nw== X-Gm-Message-State: ALoCoQlaxmZePpbwk62P+Jhvb1JELynGnv5XUMEgO5xGM+K9tpq0iAOpbg5lViFreYxtaahveP0N MIME-Version: 1.0 X-Received: by 10.66.62.229 with SMTP id b5mr11759919pas.30.1423643352614; Wed, 11 Feb 2015 00:29:12 -0800 (PST) Received: by 10.70.49.100 with HTTP; Wed, 11 Feb 2015 00:29:12 -0800 (PST) X-Originating-IP: [109.145.22.92] In-Reply-To: References: <54D7ED22.3080001@gmail.com> Date: Wed, 11 Feb 2015 08:29:12 +0000 Message-ID: To: Yasuo Ohgaki Cc: Dmitry Stogov , Patrick Schaaf , internals Content-Type: multipart/alternative; boundary=001a1136bd5851de0c050ecbcc3b Subject: Re: [PHP-DEV] Design by Contract From: pthreads@pthreads.org (Joe Watkins) --001a1136bd5851de0c050ecbcc3b Content-Type: text/plain; charset=UTF-8 > http://dlang.org/deprecate.html#invariant as an alias for immutable It's not an alias, the most recent compiler emits an error if you try to use invariant contracts, and immutable isn't a kind of contract. immutable is a property modifier: immutable: http://dpaste.dzfl.pl/7e724b599640 invariant (won't compile using latest release): http://dpaste.dzfl.pl/102c5c5adef5 > Isn't invariant good enough? Good enough for us, yeah. Cheers Joe On Wed, Feb 11, 2015 at 8:18 AM, Yasuo Ohgaki wrote: > Hi Joe, > > On Wed, Feb 11, 2015 at 5:02 PM, Yasuo Ohgaki wrote: > >> On Wed, Feb 11, 2015 at 4:54 PM, Joe Watkins >> wrote: >> >>> So it turns out that invariant is already deprecated in D, they have >>> dropped it in favour of immutable properties. >>> >>> I guess I'll have to install an old version, or try to extract >>> everything we need from their obviously outdated documentation ... >>> >> >> That's too bad. >> Eiffel uses invariant. >> >> https://docs.eiffel.com/book/method/et-design-contract-tm-assertions-and-exceptions >> > > http://dlang.org/deprecate.html#invariant as an alias for immutable > > I think D folks would like to be more strict. Object is great, but state > management can be complex. > I like immutable also since it prevents modification by mistake. I'm not > sure if we should go for it > without having invariant. Even if we have invariant, we may have immutable > object/scalar in the future. > Both are good. > > Isn't invariant good enough? I don't think Eiffel will drop invariant > support in favor of immutables. > > Regards, > > -- > Yasuo Ohgaki > yohgaki@ohgaki.net > --001a1136bd5851de0c050ecbcc3b--