Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35791 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77677 invoked by uid 1010); 25 Feb 2008 15:03:27 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 77661 invoked from network); 25 Feb 2008 15:03:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Feb 2008 15:03:27 -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:38974] helo=serv6.servweb.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FC/E0-07350-EB8D2C74 for ; Mon, 25 Feb 2008 10:03:27 -0500 Received: from [172.16.16.90] (toolslave.net [85.88.12.247]) by serv6.servweb.de (Postfix) with ESMTP id E3A655903C0; Mon, 25 Feb 2008 16:04:59 +0100 (CET) Message-ID: <47C2D8C5.2000401@stefan-marr.de> Date: Mon, 25 Feb 2008 16:03:33 +0100 Reply-To: php@stefan-marr.de User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Marcus Boerger Cc: Lukas Kahwe Smith , Andi Gutmans , internals@lists.php.net References: <001c01c87264$3c01b4e0$b4051ea0$@de> <698DE66518E7CA45812BD18E807866CE014A8D9D@us-ex1.zend.net> <342791187.20080225104951@marcus-boerger.de> In-Reply-To: <342791187.20080225104951@marcus-boerger.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Redirected: By TestProxy Subject: Re: [PHP-DEV] RFC: Traits for PHP From: php@stefan-marr.de (Stefan Marr) Hi, Marcus Boerger schrieb: > Trait a { > function f() {} > } > > Trait b { > function f() {} > } > > class c { > uses a, b; > function f() {} > } > > Reflection(c): > function "\0a\0f" function a::f > function "\0b\0f" function b::f > function "f" function f > > All nicely callable using array syntax: > class d extends c { > function t() { > call_user_func(array($this, "a::f")): > call_user_func(array($this, "b::f")): > call_user_func(array($this, "f")): > } > } > $o = new c: > $o->test(); May be I don't get the point completly, but having this, every thing what traits are trying to solve is lost... IMHO Instead, you are playing with the devil (C++ multiple-inheritance). The main part of the trait idea is to be able to solve conflicts explicitly. Think this is the major contribution of traits and the things being discussed here right now are not THIS kind of traits anymore. Your other mail from today goes in the same direction. I don't feel comfortable with this :( I will put together some thoughts on how we could build real traits semantics with the intended benefits you might be a bit more comfortable with. But I absolutely think the proposals from the last days are going in the wrong direction. Instead of abusing the traits idea for this, it would be a valuable contribution to make a cut and drop the traits ideas for the sake of simplicity and use some mixin mechanism instead. I'll try to have a better "real trait thing" ready in this evening. Kind Regards Stefan