Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35674 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93583 invoked by uid 1010); 21 Feb 2008 05:54:35 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 93567 invoked from network); 21 Feb 2008 05:54:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Feb 2008 05:54:35 -0000 Authentication-Results: pb1.pair.com smtp.mail=larry@garfieldtech.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=larry@garfieldtech.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain garfieldtech.com from 76.96.30.48 cause and error) X-PHP-List-Original-Sender: larry@garfieldtech.com X-Host-Fingerprint: 76.96.30.48 qmta05.emeryville.ca.mail.comcast.net Received: from [76.96.30.48] ([76.96.30.48:33016] helo=QMTA05.emeryville.ca.mail.comcast.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7F/20-20678-9121DB74 for ; Thu, 21 Feb 2008 00:54:35 -0500 Received: from OMTA02.emeryville.ca.mail.comcast.net ([76.96.30.19]) by QMTA05.emeryville.ca.mail.comcast.net with comcast id s5Wf1Y0040QkzPwA501q00; Thu, 21 Feb 2008 05:53:54 +0000 Received: from earth.ufp ([24.13.255.226]) by OMTA02.emeryville.ca.mail.comcast.net with comcast id s5uW1Y0084trKQ88N00000; Thu, 21 Feb 2008 05:54:31 +0000 X-Authority-Analysis: v=1.0 c=1 a=18Z6uouts0JFFfrWdtYA:9 a=fJHBz4mJWGQuDRjgyocA:7 a=KoeYzKruKU24l_KKEKvXNfcDtXEA:4 a=FHBbIDN7CdwA:10 a=LY0hPdMaydYA:10 Received: from localhost (localhost [127.0.0.1]) by earth.ufp (Postfix) with ESMTP id 4B0E3D8404 for ; Wed, 20 Feb 2008 23:54:30 -0600 (CST) Received: from earth.ufp ([127.0.0.1]) by localhost (earth.hsd1.il.comcast.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lD+-3aDEFgMK for ; Wed, 20 Feb 2008 23:54:30 -0600 (CST) Received: from vulcan (unknown [192.168.42.1]) by earth.ufp (Postfix) with ESMTP id 21F0DD8401 for ; Wed, 20 Feb 2008 23:54:19 -0600 (CST) To: internals@lists.php.net Date: Wed, 20 Feb 2008 23:54:18 -0600 User-Agent: KMail/1.9.6 (enterprise 0.20070907.709405) References: <001c01c87264$3c01b4e0$b4051ea0$@de> <698DE66518E7CA45812BD18E807866CE014A8D9D@us-ex1.zend.net> In-Reply-To: <698DE66518E7CA45812BD18E807866CE014A8D9D@us-ex1.zend.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <200802202354.18400.larry@garfieldtech.com> Subject: Re: [PHP-DEV] RFC: Traits for PHP From: larry@garfieldtech.com (Larry Garfield) On Wednesday 20 February 2008, Andi Gutmans wrote: > a) > I think Traits should be able to act as a self-contained behavior which can > always be expected to work. For example if I want a Counter behavior I > would like that not to depend on the properties in the containing class. > While I don't think we should enable public nor protected properties in > Traits I think allowing for private properties in Traits would come in very > handy. It also is no problem when it comes to mangling as we can use the > Trait name. > > class Trait { > private $counter = 0; > function getNextSerialNumber() { > return $this->counter++; > } > } > > I strongly recommend not to support protected/public and not to even get > into the discussion of dealing with conflicts of such properties. But I > think private is very useful. Hi Andi. Why no ppp on Traits? It seems useful to be able to pull in a utility function or functions that can be leveraged from other methods, like domain-specific parsers, without exposing them to the outside world. Is it an engine-level implementation issue, or a conceptual complexity issue? I don't really see a complexity issue on the developer level, at least for me. -- Larry Garfield AIM: LOLG42 larry@garfieldtech.com ICQ: 6817012 "If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it." -- Thomas Jefferson