RE: [PHP-DEV] Request for Comments: Horizontal Reuse for PHP
| From: | Jonathan Bond-Caron | Date: | Thu, 15 Oct 2009 13:42:28 +0000 |
| Subject: | RE: [PHP-DEV] Request for Comments: Horizontal Reuse for PHP | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-45822@lists.php.net to get a copy of this message | ||
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.