Re: [PHP-DEV] Request for Comments: Horizontal Reuse for PHP

2009-10-15 Thread Tom Boutell
On Thu, Oct 15, 2009 at 10:42 AM, Stefan Marr wrote: > Hi: > > On 14 Oct 2009, at 22:44, Tom Boutell wrote: > >> I'm very concerned about the practical consequences of introducing >> traits without state. > > Well, we have not found a sufficient design until now, which would fit > nicely into PHP

Re: [PHP-DEV] Request for Comments: Horizontal Reuse for PHP

2009-10-15 Thread Stefan Marr
Hi: Has it been discussed to add a portion of the patch to HEAD? Hopefully, people can agree on a simple patch that ignores conflict resolution / aliasing solution and just adds: Ehm, hopefully not...? The power of traits is the explicit resolution of conflicts. And at least for me, that is th

Re: [PHP-DEV] Request for Comments: Horizontal Reuse for PHP

2009-10-15 Thread Stefan Marr
Hi: On 14 Oct 2009, at 22:44, Tom Boutell wrote: I'm very concerned about the practical consequences of introducing traits without state. Well, we have not found a sufficient design until now, which would fit nicely into PHP from dynamic and simplicity perspective. A. They could do this us

Re: [PHP-DEV] Request for Comments: Horizontal Reuse for PHP

2009-10-15 Thread Stefan Marr
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.

RE: [PHP-DEV] Request for Comments: Horizontal Reuse for PHP

2009-10-15 Thread 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, th

Re: [PHP-DEV] Request for Comments: Horizontal Reuse for PHP

2009-10-14 Thread Victor Bolshov
Personally, I don't get deep into how PHP works inside, I'm just a PHP-programmer (the man from userland). For me it will surely be better to use 'insteadof', not 'instead'. And It seems to me more natural to use the following syntax when using grafts: class Foo { use MyGraft { public graftedCl

Re: [PHP-DEV] Request for Comments: Horizontal Reuse for PHP

2009-10-14 Thread Tom Boutell
I'm very concerned about the practical consequences of introducing traits without state. Lacking support for properties (state) in traits, programmers will immediately start hacking properties in anyway. I see two approaches: A. They could do this using static hashes in global variables or a sep

Re: [PHP-DEV] Request for Comments: Horizontal Reuse for PHP

2009-10-14 Thread Lukas Kahwe Smith
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 wait

Re: [PHP-DEV] Request for Comments: Horizontal Reuse for PHP

2009-10-14 Thread Stanislav Malyshev
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 i

Re: [PHP-DEV] Request for Comments: Horizontal Reuse for PHP

2009-10-14 Thread Stefan Marr
On 14 Oct 2009, at 21:26, Lukas Kahwe Smith wrote: 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

Re: [PHP-DEV] Request for Comments: Horizontal Reuse for PHP

2009-10-14 Thread Lukas Kahwe Smith
Aloha, 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! regards, Lukas On 13.10.2008, at 21:12, Stefan Marr wrote: Hello, the last time the topic traits has been discussed is already a while

Re: [PHP-DEV] Request for Comments: Horizontal Reuse for PHP

2008-11-11 Thread Stan Vassilev | FM
class Helloworld { public function sayHello() { print "HELLO"; } } category HelloworldExtras on Helloworld { public function sayWorld() { print "World"; } } $h = new Helloworld; $h->sayWorld(); // print "WORLD" This is extremely beneficial for lightweight "extension" of classes without s

Re: [PHP-DEV] Request for Comments: Horizontal Reuse for PHP

2008-11-11 Thread Alan Pinstein
I was pointed to the http://wiki.php.net/rfc site the other day at the ATLPHP user group and found the traits and related RFC's. I just read the RFC on grafts and traits for PHP. Great ideas! There is one other thing I'd like you to take a look at as well though, that's very useful. Objec