Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45822 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92919 invoked from network); 15 Oct 2009 13:42:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Oct 2009 13:42:38 -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:51677] helo=mail.ca.gdesolutions.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E1/52-14330-8C627DA4 for ; Thu, 15 Oct 2009 09:42:35 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.ca.gdesolutions.com (Postfix) with ESMTP id 1EEC45D09; Thu, 15 Oct 2009 09:42:30 -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 zDAvC-snot4v; Thu, 15 Oct 2009 09:42:29 -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 8B9985C1E; Thu, 15 Oct 2009 09:42:29 -0400 (EDT) To: "'Lukas Kahwe Smith'" , "'Stanislav Malyshev'" Cc: "'Stefan Marr'" , References: <002b01c92d67$ae92fdc0$0bb8f940$@de> <9D1CD88B-3A75-453C-9515-5F31E60F90AC@pooteeweet.org> <90CF2907-8C30-4EB0-9AC5-AD00EFC14023@stefan-marr.de> <4AD62E77.9010802@zend.com> <3530BC53-F4D6-48EC-BBEB-54E79AD497C3@pooteeweet.org> In-Reply-To: <3530BC53-F4D6-48EC-BBEB-54E79AD497C3@pooteeweet.org> Date: Thu, 15 Oct 2009 09:42:28 -0400 Message-ID: <001d01ca4d9d$56fdd380$04f97a80$@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: AcpNChpQ02iJrXCtSJeyOqSmMlUwLwAh3eOg Content-Language: en-ca Subject: RE: [PHP-DEV] Request for Comments: Horizontal Reuse for PHP From: jbondc@openmv.com ("Jonathan Bond-Caron") On Wed Oct 14 04:07 PM, Lukas Kahwe Smith wrote: > > On 14.10.2009, at 22:03, Stanislav Malyshev wrote: > > > Hi! > > > >>> So lets warm this up again. > >>> HEAD is for development .. so lets get this into HEAD so that it > >>> will be part of the next bigger PHP release for sure! > >> Well, the code is sitting here > >> http://github.com/gron/php-src/tree/PHP_6-traits > >> and waits to be merged. :) > > > > I thought before merging code it would be useful to have some > > discussion on if the code is actually doing what we want. If it's > > based on http://wiki.php.net/rfc/horizontalreuse then for example I > > can see some potential issues for bytecode caching related to > renaming > > and changing visibility. > > Also, it is not clear that we want grafts there at all, some aspects > > of them seem to get too hairy, esp. $this issue or statics. > > > > i think Stefan is fully aware of that probably there will be a > discussion first .. > but i think we all agree that this feature is very high on the list of > what people want and therefore i wanted to get this discussion going, > so that after its concluded traits can be commited to HEAD. Has it been discussed to add a portion of the patch to HEAD? Reading up on scala, I really like what they've done with traits (as a developer): http://www.scala-lang.org/node/117 I've updated the RFC with an example: http://wiki.php.net/rfc/traits#scala_synthax_and_practical_example Hopefully, people can agree on a simple patch that ignores conflict resolution / aliasing solution and just adds: trait User_Comments {} class App_Document with User_Comments {} // Or the original syntax class App_Email { use User_Comments; } The details of conflict resolution, if the use cases are strong enough can come later. Grafts well... the re-use is interesting but I worry about how php is going to evolve is you start offering that much flexibility. Just my thoughts, great work though.