Re: [PHP-DEV] horizontal reuse: traits vs. grafts

2010-03-26 Thread Sebastian Bergmann
Stefan Marr wrote: Well, my personal (I admit very academic) position is: - Traits are not classes - Traits are not interfaces - Traits are not types - Traits cannot be instantiated Thus, there is no meaning of a is_a and instanceof +1 -- Sebastian Bergmann

Re: [PHP-DEV] horizontal reuse: traits vs. grafts

2010-03-26 Thread mathieu.suen
Stefan Marr wrote: On 25 Mar 2010, at 21:30, Stefan Marr wrote: On 25 Mar 2010, at 16:37, Lukas Kahwe Smith wrote: Hi, this was just brought up on IRC. my understanding is that traits have no concept of properties, but grafts do (all hidden internally). correct? Right, the

Re: [PHP-DEV] horizontal reuse: traits vs. grafts

2010-03-26 Thread Stefan Marr
On 26 Mar 2010, at 10:26, mathieu.suen wrote: Variable has been discuss in *http://tinyurl.com/y9t7nd9 Right, and related to that we have freezable traits http://scg.unibe.ch/scgbib?_k=NNRwidu5query=freezable+traitsdisplay=abstract Which influenced this RFC for PHP:

Re: [PHP-DEV] horizontal reuse: traits vs. grafts

2010-03-26 Thread mathieu.suen
Stefan Marr wrote: On 26 Mar 2010, at 10:26, mathieu.suen wrote: Variable has been discuss in *http://tinyurl.com/y9t7nd9 Right, and related to that we have freezable traits http://scg.unibe.ch/scgbib?_k=NNRwidu5query=freezable+traitsdisplay=abstract Which influenced this RFC for

Re: [PHP-DEV] horizontal reuse: traits vs. grafts

2010-03-25 Thread David Soria Parra
Just as a general idea (which is certainly something after traits are implemented once) Scala offers stackable traits so that you can mixin traits during object creation. An example: trait Philosophical { public function think () { echo Cogito ergo sum; } } trait Drink {

Re: [PHP-DEV] horizontal reuse: traits vs. grafts

2010-03-25 Thread Lukas Kahwe Smith
On 25.03.2010, at 14:48, David Soria Parra wrote: Just as a general idea (which is certainly something after traits are implemented once) Scala offers stackable traits so that you can mixin traits during object creation. An example: trait Philosophical { public function think ()

Re: [PHP-DEV] horizontal reuse: traits vs. grafts

2010-03-25 Thread Stefan Marr
On 25 Mar 2010, at 16:00, Lukas Kahwe Smith wrote: On 25.03.2010, at 14:48, David Soria Parra wrote: This approach is taken in scala and works pretty fine there for composing classes during runtime and should be douable in PHP too. For sure aliasing is not possible in this example. But

Re: [PHP-DEV] horizontal reuse: traits vs. grafts

2010-03-25 Thread Lukas Kahwe Smith
Hi, this was just brought up on IRC. my understanding is that traits have no concept of properties, but grafts do (all hidden internally). correct? regards, Lukas Kahwe Smith m...@pooteeweet.org -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit:

Re: [PHP-DEV] horizontal reuse: traits vs. grafts

2010-03-25 Thread David Soria Parra
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 25.03.10 16:21, schrieb Stefan Marr: On 25 Mar 2010, at 16:00, Lukas Kahwe Smith wrote: On 25.03.2010, at 14:48, David Soria Parra wrote: This approach is taken in scala and works pretty fine there for composing classes during runtime and

Re: [PHP-DEV] horizontal reuse: traits vs. grafts

2010-03-25 Thread troels knak-nielsen
Hi On Thu, Mar 25, 2010 at 4:00 PM, Lukas Kahwe Smith m...@pooteeweet.org wrote: On 25.03.2010, at 14:48, David Soria Parra wrote: Stefan what do you think about stackable traits ? Woha .. that code really scares me. While I like features like this in other languages, I think it would be a

Re: [PHP-DEV] horizontal reuse: traits vs. grafts

2010-03-25 Thread Stefan Marr
Hi, On 24 Mar 2010, at 11:50, Lukas Kahwe Smith wrote: In case of the above definition of Talker, PHP will show a warning that there have been conflicts and name the methods smallTalk() and bigTalk() as the reason of this conflict. Therefore, neither of the given implementations will be

Re: [PHP-DEV] horizontal reuse: traits vs. grafts

2010-03-25 Thread Stefan Marr
Hi: On 24 Mar 2010, at 17:58, Jonathan Bond-Caron wrote: One thing I feel is missing from the RFC is how is_a() and instanceof are affected with traits or grafts. Well, my personal (I admit very academic) position is: - Traits are not classes - Traits are not interfaces - Traits are not

Re: [PHP-DEV] horizontal reuse: traits vs. grafts

2010-03-25 Thread Stefan Marr
On 25 Mar 2010, at 16:37, Lukas Kahwe Smith wrote: Hi, this was just brought up on IRC. my understanding is that traits have no concept of properties, but grafts do (all hidden internally). correct? Right, the Traits proposal as it is at the moment, avoids the explicit discussion of

Re: [PHP-DEV] horizontal reuse: traits vs. grafts

2010-03-25 Thread Stefan Marr
On 25 Mar 2010, at 21:30, Stefan Marr wrote: On 25 Mar 2010, at 16:37, Lukas Kahwe Smith wrote: Hi, this was just brought up on IRC. my understanding is that traits have no concept of properties, but grafts do (all hidden internally). correct? Right, the Traits proposal as it is at the

Re: [PHP-DEV] horizontal reuse: traits vs. grafts

2010-03-25 Thread Lukas Kahwe Smith
On 25.03.2010, at 21:13, Stefan Marr wrote: On 24 Mar 2010, at 11:50, Lukas Kahwe Smith wrote: In case of the above definition of Talker, PHP will show a warning that there have been conflicts and name the methods smallTalk() and bigTalk() as the reason of this conflict. Therefore, neither

Re: [PHP-DEV] horizontal reuse: traits vs. grafts

2010-03-25 Thread Lukas Kahwe Smith
On 25.03.2010, at 21:23, Stefan Marr wrote: Hi: On 24 Mar 2010, at 17:58, Jonathan Bond-Caron wrote: One thing I feel is missing from the RFC is how is_a() and instanceof are affected with traits or grafts. Well, my personal (I admit very academic) position is: - Traits are not classes

Re: [PHP-DEV] horizontal reuse: traits vs. grafts

2010-03-25 Thread Lukas Kahwe Smith
On 25.03.2010, at 22:59, Stefan Marr wrote: On 25 Mar 2010, at 21:30, Stefan Marr wrote: On 25 Mar 2010, at 16:37, Lukas Kahwe Smith wrote: Hi, this was just brought up on IRC. my understanding is that traits have no concept of properties, but grafts do (all hidden internally).

[PHP-DEV] horizontal reuse: traits vs. grafts

2010-03-24 Thread Lukas Kahwe Smith
Ahoi, Thought it would be better to open up a new thread and also using the term horizontal reuse in the subject so that we make it clearer that there are actually two approaches. Here is the URL for Stefan's proposal: http://wiki.php.net/rfc/horizontalreuse In case of the above definition of

RE: [PHP-DEV] horizontal reuse: traits vs. grafts

2010-03-24 Thread Jonathan Bond-Caron
On Wed Mar 24 06:50 AM, Lukas Kahwe Smith wrote: Ahoi, Thought it would be better to open up a new thread and also using the term horizontal reuse in the subject so that we make it clearer that there are actually two approaches. Here is the URL for Stefan's proposal:

RE: [PHP-DEV] horizontal reuse: traits vs. grafts

2010-03-24 Thread Jonathan Bond-Caron
On Wed Mar 24 06:50 AM, Lukas Kahwe Smith wrote: The third sentence is not so clear to me, but if I guess it its also just a typo as it makes more sense to me when replacing renaming to result in renaming. But maybe you could tweak that paragraph to be a bit clearer. For example its still

Re: [PHP-DEV] horizontal reuse: traits vs. grafts

2010-03-24 Thread Stefan Marr
Hi Lukas, Hi Jonathan: Just a quick response on the renaming issue. On 24 Mar 2010, at 18:04, Jonathan Bond-Caron wrote: On Wed Mar 24 06:50 AM, Lukas Kahwe Smith wrote: The third sentence is not so clear to me, but if I guess it its also just a typo as it makes more sense to me when