Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47570 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40319 invoked from network); 24 Mar 2010 17:04:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Mar 2010 17:04:24 -0000 Authentication-Results: pb1.pair.com smtp.mail=jbondc@openmv.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=jbondc@openmv.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain openmv.com from 64.15.152.204 cause and error) X-PHP-List-Original-Sender: jbondc@openmv.com X-Host-Fingerprint: 64.15.152.204 mail.ca.gdesolutions.com Received: from [64.15.152.204] ([64.15.152.204:58587] helo=mail.ca.gdesolutions.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F1/C6-33174-6164AAB4 for ; Wed, 24 Mar 2010 12:04:23 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.ca.gdesolutions.com (Postfix) with ESMTP id DA6585D7C; Wed, 24 Mar 2010 13:04:19 -0400 (EDT) X-Virus-Scanned: amavisd-new at gdesolutions.com Received: from mail.ca.gdesolutions.com ([127.0.0.1]) by localhost (mail.ca.gdesolutions.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PieG8NU0talV; Wed, 24 Mar 2010 13:04:19 -0400 (EDT) Received: from djbondc (modemcable083.208-56-74.mc.videotron.ca [74.56.208.83]) by mail.ca.gdesolutions.com (Postfix) with ESMTP id 6F5DE5D79; Wed, 24 Mar 2010 13:04:19 -0400 (EDT) To: "'Lukas Kahwe Smith'" , "'PHP Developers Mailing List'" References: <690D1362-7F1D-47B9-A4BF-EEA9CF38C5B0@pooteeweet.org> In-Reply-To: <690D1362-7F1D-47B9-A4BF-EEA9CF38C5B0@pooteeweet.org> Date: Wed, 24 Mar 2010 13:04:18 -0400 Message-ID: <001601cacb74$0b037020$210a5060$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcrLQJfi1ZbdCTeeQX+Udsu3kpiQfAAMcYMg Content-Language: en-ca Subject: RE: [PHP-DEV] horizontal reuse: traits vs. grafts From: jbondc@openmv.com ("Jonathan Bond-Caron") On Wed Mar 24 06:50 AM, Lukas Kahwe Smith wrote: > The third sentence is not so clear to me, but if I guess it its also > just a typo as it makes more sense to me when replacing "renaming" to > "result in renaming". But maybe you could tweak that paragraph to be a > bit clearer. For example its still not totally clear to me why > aliasing doesn't imply inclusion, I guess its definitely more > flexible. It was really unclear to me too, this example cleared it up: http://github.com/gron/php-src/blob/PHP_5_3-traits/Zend/tests/traits/bugs/al ias-semantics.phpt The current trait implementation does not 'rename' the previous method but creates an 'alias'. > class Talker { > use A, B { > B::smallTalk instead A; > A::bigTalk instead B; > B::smallTalk as talk; > } > } I think in this case, it would output 'A'. Personally I would prefer to see: class Talker { use A { public function bigTalk(); } use B { public function smallTalk(); public function smallTalk() as talk(); // this 'renames' the function / not an alias } } Other example: class Talker { use A; use B { public function smallTalk() as talk(); } }