Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97367 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8360 invoked from network); 12 Dec 2016 14:44:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Dec 2016 14:44:05 -0000 Authentication-Results: pb1.pair.com header.from=marijic.silvio@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=marijic.silvio@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.182 as permitted sender) X-PHP-List-Original-Sender: marijic.silvio@gmail.com X-Host-Fingerprint: 209.85.223.182 mail-io0-f182.google.com Received: from [209.85.223.182] ([209.85.223.182:34670] helo=mail-io0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0F/1A-27518-4B7BE485 for ; Mon, 12 Dec 2016 09:44:05 -0500 Received: by mail-io0-f182.google.com with SMTP id p42so178375428ioo.1 for ; Mon, 12 Dec 2016 06:44:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=+PBYoC0RIj8FbKhxP2SaHhOI3vQ07x1Toi//YEiTfWg=; b=yb11nYWr7WlGlJrswaygtv34SxGdfSiukr4se3iP1JJZ1xPfnMRIMYZ0lOCUdQVQfZ Dox6tM/J/GJbdvHuoUk82ADKwxxnEbjaicN1ld1xHqaKgVh99l+9sIOoQv9iQCjT41Mw HZAFGX0hK1uv4R/SvoJEbI1eBvXp6VjdwMtOXvTp4ZWtoYJy7vgI5iJyeX2Gr0RzXT8x uZs8JVA7fWKRD9aLHWVnOpu63mM9G+5fFIB6F8+UodAbJOn2PNShq7akpVaZlEjKCljP XHvPmJXBCl525yOQ0mzUgY4FhM0uKrXaFh2LvJ+WxyxI+RED2iV2IUXXjNjxrgzWOYm5 PWYA== 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:from:date :message-id:subject:to:cc; bh=+PBYoC0RIj8FbKhxP2SaHhOI3vQ07x1Toi//YEiTfWg=; b=IhX0tu1iKNjmyLVHWfZjU+wG6K2opRhGKnhLU8cgTJR1DvOkNiUYi8TTjNGexrrqEc +b+YuAAeWYBoD5KWF55uJg7oSrRbTWPDijR9i3eTtuM93YWY/Fssz5gTXCUeuxZ/W5kB o57mluCjbEMm5SwhFBWTtyVZMpeJdttOKVAKUWFfp5kAzxNo2vL0qAsKCkgqcStia5li TGYf68QBULrE/zDjFU7iQ4Epc+1+so+cFH1RZaf3QMTHV5Oy0kDW0GUcrWPTlYfjF12m IcyCQXum2vFA2kwqMgjuk2Y4NrTFnsKYjRFdTmHCQWJvFTyxqZDcsB72sjyi5llJf8M7 jEGg== X-Gm-Message-State: AKaTC01JTzhwgS9VP2a+NruU0v6ueM8wdjZl3ry2drq39wZq5hthgdwax1edk/xpCH8MkR5mS0/TWzSW1crs5g== X-Received: by 10.36.51.76 with SMTP id k73mr10087621itk.22.1481553804654; Mon, 12 Dec 2016 06:43:24 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.110.142 with HTTP; Mon, 12 Dec 2016 06:43:24 -0800 (PST) In-Reply-To: <76C07EDB-56B3-46AB-A5C1-92485B32C113@gmail.com> References: <1807f949-81d3-f2c4-8706-0fdade3ea51d@garfieldtech.com> <4635ac4b-844a-b023-5ad9-e8524a156404@texthtml.net> <79ea244b-9fe7-5b05-d429-bf5585215542@texthtml.net> <76C07EDB-56B3-46AB-A5C1-92485B32C113@gmail.com> Date: Mon, 12 Dec 2016 15:43:24 +0100 Message-ID: To: Rowan Collins Cc: PHP Internals List Content-Type: multipart/alternative; boundary=001a113f6a1c3dff210543772099 Subject: Re: [PHP-DEV][RFC][DISCUSSION] - Immutable classes and properties From: marijic.silvio@gmail.com (=?UTF-8?Q?Silvio_Mariji=C4=87?=) --001a113f6a1c3dff210543772099 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2016-12-12 15:14 GMT+01:00 Rowan Collins : > On 12 December 2016 09:11:17 GMT+00:00, "Silvio Mariji=C4=87" < > marijic.silvio@gmail.com> wrote: > >Regarding my proposal above, since copy() would essentially operate > >only on > >immutable objects, why not put it only there. So you would be able to > >make > >a call like this one $immutable->copy(array $args); or > >$this->copy(array > >$args); depending on whether you are inside let's say with* method or > >outside of the object. > > If users of the object can set arbitrary (public) properties this way, > then you've thrown away a bunch of the free encapsulation the immutable > keyword gave you in the first place. What you get is an enforced > copy-on-write, where you can set the properties to whatever state you lik= e, > just not using normal object passing semantics. That's very different fro= m > what the RFC shows, which are properties which are publicly readable, but > whose state is exclusively controlled by the class (and its descendants). > > > PS The rule on this mailing list is too always reply *below* the text > you're replying to. > I understand that, but I think we'll have to meet in the middle. How woul= d > you handle situation where for one little change you have to manually > recreate not so trivial object with a lot of arguments ? I don't think th= at > should be a deal breaker for this RFC but I do agree that we should try t= o > find solution to bridge that gap and put that aside in a other rfc. > -- > Rowan Collins > [IMSoP] > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --=20 Silvio Mariji=C4=87 Software Engineer 2e Systems --001a113f6a1c3dff210543772099--