Re: [PHP-DEV] Re: How to build a real Trait thing without exclusion and renaming

2008-02-28 Thread Marcus Boerger
Hello Lukas, you still cannot ignore basic inheritance or reuse rules. Protocols have to be respected -> E_FATAL, fix your code. marcus Wednesday, February 27, 2008, 1:49:58 PM, you wrote: > On 26.02.2008, at 04:19, Gregory Beaver wrote: >> My only objection is that this introduces two new

Re: [PHP-DEV] Re: How to build a real Trait thing without exclusion and renaming

2008-02-28 Thread Edmund Tam
"Stefan Marr" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > class Talker { > use A, B, C, D { > B::smallTalk instead A, C, D; //to be read like: use B::smallTalk > // instead the implementations form A, C, D >} > } Excuse me for just raisin

Re: [PHP-DEV] Re: How to build a real Trait thing without exclusion and renaming

2008-02-27 Thread Lokrain
Hi Gregory and others, Traits rox! I will never use them cause I think in different way, but for many people this will be a great feature. Gregory, the comment you added here: OK, since none of my suggestions are acceptable, let me put it this way: Childish story! I want my toy! I am fully +1

Re: [PHP-DEV] Re: How to build a real Trait thing without exclusion and renaming

2008-02-27 Thread Gregory Beaver
Lukas Kahwe Smith wrote: > > On 26.02.2008, at 04:19, Gregory Beaver wrote: > >> My only objection is that this introduces two new keywords, trait and >> instead. In addition, this can get very awkward if multiple traits >> (more than 2) implement the same method name. I would prefer a simple >>

Re: [PHP-DEV] Re: How to build a real Trait thing without exclusion and renaming

2008-02-27 Thread Jochem Maas
Hi, I had a thought about recursion (and self referencing) inside trait defined functions and the possible issues that might occur due to explicit/implicit conflict resolution and or aliasing/renaming (i'm not completely following what the status quo is regarding conflict resolution and/or aliasi

Re: [PHP-DEV] Re: How to build a real Trait thing without exclusion and renaming

2008-02-27 Thread Stefan Marr
Lukas Kahwe Smith schrieb: class Talker { use A, B, C, D { smallTalk = A::smallTalk; // this says that if B, C or D implement smallTalk, it is ignored talk = A::bigTalk; } } Well this is not just a different syntax, but an entirely different approach. In Stefan's proposal one had to ex

Re: [PHP-DEV] Re: How to build a real Trait thing without exclusion and renaming

2008-02-27 Thread Lukas Kahwe Smith
On 26.02.2008, at 04:19, Gregory Beaver wrote: My only objection is that this introduces two new keywords, trait and instead. In addition, this can get very awkward if multiple traits (more than 2) implement the same method name. I would prefer a simple recycling of the "=" sign for both use

Re: [PHP-DEV] Re: How to build a real Trait thing without exclusion and renaming

2008-02-27 Thread Richard Quadling
On 27/02/2008, Joshua Thompson <[EMAIL PROTECTED]> wrote: > > // now to the questions > $talker = new Talker(); > echo $talker->talk(); // What does this echo? My assumption is 'B'. > echo $talker->bigTalk(); // How about this? > echo $talker->smallTalk(); // This should be 'b'. Wouldn't tra

Re: [PHP-DEV] Re: How to build a real Trait thing without exclusion and renaming

2008-02-27 Thread Stefan Marr
Hi Joshua, Joshua Thompson schrieb: trait A { public function smallTalk() { return 'a'; } public function bigTalk() { return strtoupper( $this->smallTalk() ); } } trait B { public function smallTalk() { return 'b'; } public function bigTalk() { return strtoupper( $t

[PHP-DEV] Re: How to build a real Trait thing without exclusion and renaming

2008-02-26 Thread Joshua Thompson
Stefan Marr wrote: //Example from the RFC with the cross-over conflict to be solved trait A { public function smallTalk() { echo 'a'; } public function bigTalk() { echo 'A'; } } trait B { public function smallTalk() { echo 'b'; } public function bigTalk() { echo 'B

[PHP-DEV] Re: How to build a real Trait thing without exclusion and renaming

2008-02-25 Thread Gregory Beaver
Stefan Marr wrote: > To get rid of exclude and rename I would like to propose the following: > > //Example from the RFC with the cross-over conflict to be solved > trait A { > public function smallTalk() { > echo 'a'; > } > public function bigTalk() { > echo 'A'; > } > } > > tr