Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35851 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5084 invoked by uid 1010); 28 Feb 2008 14:40:51 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 5069 invoked from network); 28 Feb 2008 14:40:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Feb 2008 14:40:51 -0000 Authentication-Results: pb1.pair.com smtp.mail=helly@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=helly@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 85.214.94.56 as permitted sender) X-PHP-List-Original-Sender: helly@php.net X-Host-Fingerprint: 85.214.94.56 aixcept.net Linux 2.6 Received: from [85.214.94.56] ([85.214.94.56:59746] helo=h1149922.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5A/50-08995-2F7C6C74 for ; Thu, 28 Feb 2008 09:40:51 -0500 Received: from MBOERGER-ZRH (unknown [193.142.125.1]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by h1149922.serverkompetenz.net (Postfix) with ESMTP id E0BC811F479; Thu, 28 Feb 2008 15:40:47 +0100 (CET) Date: Thu, 28 Feb 2008 15:40:50 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <1841221239.20080228154050@marcus-boerger.de> To: Stefan Marr CC: Joshua Thompson , internals@lists.php.net, Andi Gutmans In-Reply-To: <47C66328.10606@stefan-marr.de> References: <47C317F4.2080301@stefan-marr.de> <698DE66518E7CA45812BD18E807866CE01506447@us-ex1.zend.net> <36.91.14752.56226C74@pb1.pair.com> <47C66328.10606@stefan-marr.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] How to build a real Trait thing without exclusion and renaming From: helly@php.net (Marcus Boerger) Hello Stefan, Thursday, February 28, 2008, 8:30:48 AM, you wrote: > Hi, > Joshua Thompson schrieb: >> Andi Gutmans wrote: >>> The following code shows a few things: >>> - local properties which can be used in self-contained functionality. >>> The storage is guaranteed to stay internal and will not clash with the >>> aggregating class. > Yes, it is a nice to have. >>> - methods are by default hidden to the aggregating class and bound to >>> the trait (as Marcus pointed out the method name would be mangled with >>> the trait's name) > Hm, ok. It is the pessimistic counterpart to my proposal. In general, > I'm much more optimistic and would prefer to teach developers to use > proper naming to avoid conflicts. But if there is no other way to go, it > is ok. I did a lot of tutorials and sessions on object oriented PHP and I have learned one thing we have to make it easy and limit the ability to use stuff wrong. In other words we have to be pessimistic. Otherwise we end up in a mess. >> I was working on a detailed RFC of something along these lines. I didn't >> include the local keyword, instead I went the route of stateful traits >> and forced the definition of which scope in the class. I also tried to >> keep the number of keywords to 1 (`trait`). >> >> I will keep working on it, and hopefully post it tomorrow for review. > Looking forward to read it :) Same here Best regards, Marcus