Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63691 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40293 invoked from network); 28 Oct 2012 15:51:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Oct 2012 15:51:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=cpriest@zerocue.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cpriest@zerocue.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zerocue.com designates 67.200.53.250 as permitted sender) X-PHP-List-Original-Sender: cpriest@zerocue.com X-Host-Fingerprint: 67.200.53.250 mail.zerocue.com Received: from [67.200.53.250] ([67.200.53.250:51429] helo=mail.zerocue.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5C/A6-18930-7645D805 for ; Sun, 28 Oct 2012 10:51:06 -0500 Received: from [172.17.0.122] (unknown [72.179.52.187]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.zerocue.com (Postfix) with ESMTPSA id 0E98512037B; Sun, 28 Oct 2012 15:51:01 +0000 (UTC) Message-ID: <508D5462.4070503@zerocue.com> Date: Sun, 28 Oct 2012 10:50:58 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Stas Malyshev CC: PHP Developers Mailing List References: <508A67E6.2000405@zerocue.com> <508A9AC9.50200@sugarcrm.com> <508AF3E7.7020004@sugarcrm.com> <508B1EA2.8060203@sugarcrm.com> <508C249D.1000309@zerocue.com> <508C43ED.9000209@sugarcrm.com> <508C80C6.9000008@zerocue.com> <508CD916.1070509@sugarcrm.com> In-Reply-To: <508CD916.1070509@sugarcrm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Property Accessors v1.2 : Internal Accessor Method Visibility / Callability From: cpriest@zerocue.com (Clint Priest) On 10/28/2012 2:04 AM, Stas Malyshev wrote: > Hi! > >> Stas, you should probably do some research before posting such non-sense: > Which part is "non-sense"? I've brought you examples of Python and Ruby > not doing exactly what you claim all languages are doing. By your > definition, they don't have accessors - as you define accessors as > hidden methods that are uncallable and unavailable and not defined as > regular methods. In both Ruby and Python they are callable and defined > as regular (or regular with some special attributes) method. > > I've brought you examples of popular languages that don't have this > feature at all - Java and standard C++ don't have it. I was wrong on > Javascript - though in Javascript, functions work differently from PHP > so there's no real relation to the current discussion. > >> By accessors I am simply referring to getters, setters (and in the case >> of php, issetter and unsetter). > I wish it was so, but it was mentioned many times in this discussion > that "accessors should be accessors" and that only the situation where > accessors are special functions that are not defined as regular methods, > are not callable and are hidden from reflection, etc. is the situation > where "accessors are accessors". This is not the case in Python, Ruby, > MS C++, D and Delphi by your own link - in all these cases, the > properties are defined as regular methods (possibly with some special > salt added) and no special effort is taken to hide them from any of the > language facilities and make them not callable. > Of course, there are also examples of languages going the other way - > namely, C#, F# and VB - but by no means the claim that I would be hard > pressed to find example of the languages which do not implement your > notion of "accessors being accessors" is true. For most dynamic > languages, the concept of "accessors being accessors" - hidden, > non-callable pseudo-methods - is a foreign concept. > I see what you're talking about, I felt like you were saying these other languages did not support accessors (getters, setters, etc). Those other languages do not "hide" them, no. This was Nikita's suggestion, I will let her fight for it. -- -Clint