Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35816 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10139 invoked by uid 1010); 27 Feb 2008 14:20:16 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 10123 invoked from network); 27 Feb 2008 14:20:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Feb 2008 14:20:16 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@stefan-marr.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php@stefan-marr.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain stefan-marr.de from 82.96.83.42 cause and error) X-PHP-List-Original-Sender: php@stefan-marr.de X-Host-Fingerprint: 82.96.83.42 serv6.servweb.de Linux 2.4/2.6 Received: from [82.96.83.42] ([82.96.83.42:35568] helo=serv6.servweb.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 80/C5-63317-F9175C74 for ; Wed, 27 Feb 2008 09:20:16 -0500 Received: from [172.16.16.90] (toolslave.net [85.88.12.247]) by serv6.servweb.de (Postfix) with ESMTP id B94FB590028; Wed, 27 Feb 2008 15:20:12 +0100 (CET) Message-ID: <47C571A7.9030701@stefan-marr.de> Date: Wed, 27 Feb 2008 15:20:23 +0100 Reply-To: php@stefan-marr.de User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: RQuadling@GoogleMail.com Cc: Internals Mailing List References: <47C317F4.2080301@stefan-marr.de> <10845a340802251336l4ec51e2bg493f0bd8e4684264@mail.gmail.com> In-Reply-To: <10845a340802251336l4ec51e2bg493f0bd8e4684264@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Redirected: By TestProxy Subject: Re: [PHP-DEV] How to build a real Trait thing without exclusion and renaming From: php@stefan-marr.de (Stefan Marr) Hi Richard, Richard Quadling schrieb: > Traits as namespaces would solve the issue of conflict in the class > Talker (you would have to explicitly say which trait the method came > from. Yes, this would solve the conflicts, but is this really handy? Every explicit reference to a trait/class name has to be adjusted if the name changes or if there are any incompatible changes in the hierarchies. Explicit references by names is probably always a solution, but not the best. The inventors of the trait idea tried to avoid it in favor to avoid the fragility introduced by it. > > I don't know if this can all be resolved at compile time. Surely the > use of call_user_func() and others would impact somehow. > > If trait C requires trait D, then this may lead to longer namespaces - > but from my understanding the purpose of namespaces is to resolve > collisions, so it cannot be avoided when there are collisions. (Though > my example doesn't collide - but that's not the point). > > I hope this makes some sense. It would be a possible way, but personally I would not like to go there. Kind Regards Stefan