Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42047 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9422 invoked from network); 25 Nov 2008 21:17:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Nov 2008 21:17:03 -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 85.88.12.247 cause and error) X-PHP-List-Original-Sender: php@stefan-marr.de X-Host-Fingerprint: 85.88.12.247 toolslave.net Received: from [85.88.12.247] ([85.88.12.247:60768] helo=uhweb12247.united-hoster.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9E/81-14465-D4B6C294 for ; Tue, 25 Nov 2008 16:17:02 -0500 Received: from [91.180.176.140] (helo=[192.168.1.12]) by uhweb12247.united-hoster.com with esmtpsa (TLS-1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.66) (envelope-from ) id 1L55H2-00024D-Qn; Tue, 25 Nov 2008 22:16:56 +0100 To: Marcus Boerger In-Reply-To: <557209447.20081125133950@marcus-boerger.de> X-Priority: 3 (Normal) References: <002b01c92d67$ae92fdc0$0bb8f940$@de> <79.C8.07308.CDE4C194@pb1.pair.com> <49203DF2.1020006@stefan-marr.de> <45289205.20081125005213@marcus-boerger.de> <492B62A1.2000207@rwth-aachen.de> <557209447.20081125133950@marcus-boerger.de> Message-ID: <096F09EE-A0BC-40F9-811A-B78C7E6F4A7C@stefan-marr.de> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Date: Tue, 25 Nov 2008 22:16:38 +0100 Cc: Christopher Vogt , internals@lists.php.net X-Mailer: Apple Mail (2.929.2) Subject: Re: [PHP-DEV] Grafts, Traits, horizontal reuse From: php@stefan-marr.de (Stefan Marr) Hi, On 25 Nov 2008, at 13:39, Marcus Boerger wrote: > > Your points are all well observed. And yes I limit what my approach > can > do in order to Keep It Simple Safe (KISS). While still being able to > manually interfere with/overload the autogenerated code when > necessary. > At the same time forcing to delegate to a defined Interface and not > allowing to rename on the fly prevents abusing the functionality and > helps maintainability. On the other hand it forces you to think before > coding as this approach comes with a lack of functionality. Ok, but now we start to talk about two clearly different things. On the one hand something like traits, mixins, or what ever, and restricted syntax sugar for delegation on the other hand. While designing grafts, the idea was to provide a similar power like traits do, but introducing state and encapsulation. From my point of view, there is no other way to achieve this. At least I have not found it. All things in between, like "unbreakable traits" add more complexity then they solve problems. So actually, we are somewhere near the point which I intended to reach with my proposal. The questions we should answer now are: - Does PHP need horizontal reuse? - Do we go for an explicit solution? (traits) - Do we go for some sort of syntax sugar for delegation? (grafts, delegate keyword) - Or do we go the implicit way? (mixins, phyton multiple-inheritance) Nevertheless, I would love to get some more comments on grafts before answering this questions, because this could give additional insights in the real problems with this approach and some ideas for improvements. Best Regards Stefan