Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92244 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69539 invoked from network); 13 Apr 2016 04:42:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Apr 2016 04:42:55 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.174 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.174 mail-pf0-f174.google.com Received: from [209.85.192.174] ([209.85.192.174:32972] helo=mail-pf0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9C/50-01788-F4ECD075 for ; Wed, 13 Apr 2016 00:42:55 -0400 Received: by mail-pf0-f174.google.com with SMTP id 184so26952560pff.0 for ; Tue, 12 Apr 2016 21:42:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=vJMfjhP2zCV/+3Bsv/rvSpc0Or/shMEP7hNmTea0dW0=; b=XqOckTUkmvJeI8yBZNnVZKm4/A2sq9OvhosG2bP8iovuBzvdVjdY1sPA++o4sO9njK dn2L57iRBTgvaxiBwRRALvxm/h7diGVdoDCM6JERXX64etfIBalLAmdWLooDXmwXOc3L omC5m7KnAkSu5RqVBLw98S6+f9cgd1tPX5ZtM2733rXX6L7spZueXNww2gNZCesXbAKs HqQ7/bQqA+1e9F30v072pisaed3hZVrTJQwIZyFrtcK7mWUDAwx2y+3PeLcxdE0hTcei bxLBXSW0LCi4IDq51FRl3oHKhiqsjhh4MkLpqvoeDtuYBHBFlp1QtjsVFxlHHsVk9YpO Ym8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=vJMfjhP2zCV/+3Bsv/rvSpc0Or/shMEP7hNmTea0dW0=; b=RMOt8V3HN3696xnQxnZuJ7BkjsMy2PJeqV/xeHLxTUfF++qIVUTRmhEb/GoXlKB/0D rROGeMnOS16kZo28sLV7f1qWtPdnCreyT7O54mkj0Kg+hIi4OeyPxTxkV4FByhoUJw6o vFXYERSowm+peNBbYdBnBRevR60TkKuRw0cVOpa6qfO8XCVj5kN3O/ndwOx4Knag7YMb kzmI30Lk4ckQFpjmed2+nQZtpFMSqkVFzFMERupLBxuwy0ZN3KFkd3JQkH3kmwYdcaVG +9DqQyv9jO1Pus7gX7lQsKHK0L8bJzuFwBQC27fZEpwu2ceddQQe2rjfPwST1vmWWkGL rTUw== X-Gm-Message-State: AOPr4FUL7ZAeb6KDmQrWLVwXXAikBlKDJguvcxQqCBL5Op4WwCQRoy7HVqsK0BcJeIoFKg== X-Received: by 10.98.10.147 with SMTP id 19mr10055673pfk.87.1460522571601; Tue, 12 Apr 2016 21:42:51 -0700 (PDT) Received: from Stas-Air.local (76-220-46-95.lightspeed.sntcca.sbcglobal.net. [76.220.46.95]) by smtp.gmail.com with ESMTPSA id h85sm47195836pfj.52.2016.04.12.21.42.50 for (version=TLSv1/SSLv3 cipher=OTHER); Tue, 12 Apr 2016 21:42:50 -0700 (PDT) To: internals@lists.php.net References: <5708B197.9020108@php.net> <9C0BBB93-8173-45CF-9636-888B340828FD@ez.no> <57090928.3040905@php.net> <570BD5E6.2000304@fleshgrinder.com> Message-ID: <570DCE46.3020800@gmail.com> Date: Tue, 12 Apr 2016 21:42:46 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <570BD5E6.2000304@fleshgrinder.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Final properties From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > The *var* keyword is not going to be deprecated and its meaning is > currently kind of ambiguous. I tried to assign it a new meaning in > the Why is it ambiguous? It's pretty well defined, it's the same as public. > class Foo { > > val $x; > > var $y; > > val $z; > > } > > class Bar extends Foo { > > var $x; > > $y; > > $z; > > } This looks very unobvious what is supposed to be going on here. I'd much prefer to have every specification be explicit. > The /z/ will stay a *val* (immutable) because its parent > declaration is defined as such. > > class Point { > > final public float val $x = 0.0; Wait, how is this different from a constant? > The *final* keyword could be added via another RFC and it would > have the same meaning as the *final* keyword for classes and > methods: freeze the definition. This is why the *MutablePoint* > results in fatal errors: it tries to redeclare /x/ and /y/ from > *val* to *var* although they are *final*. I'm not sure I understand what is the point in freezing the definition. Could you explain use case for such thing? > I think that Scala's *val*/*var* approach could really help us to > make *var* usable again in a meaningful manner and it corresponds > nicely to the concept of /value objects/ and related concepts with > its naming scheme. I'm not sure why var is unusable and why it is a worthy goal to make it "usable again" - i.e. what exactly we are trying to achieve here? If we want value objects, it *might* be valuable to have an object that is readable but not writable from outside - even though it is easily achievable right now by having public getters but no public setters. But I'm not sure how "var" - or, for that matter, "final" - fits the picture. -- Stas Malyshev smalyshev@gmail.com