[EMAIL PROTECTED] wrote:
Hi,

during last six months I've studied a language construct called Traits.
It is a construct to allow fine-grained code reuse and in my opinon
this would be a nice feature for PHP, which I did like to propose here.
The following RFC deals with the questions what Traits are, how they are
used, why they are usefull and how they do look like in PHP.
A patch implementing this new language construct is available, too.

Thank you for your attention and I'm looking forward to hear your comments
:)

Kind Regards
Stefan

I came across one piece of information on aliasing that may not be obvious at first and therefore should probably be explicitly stated in the RFC and in the manual when this makes it into the core.

Quoting <http://www.iam.unibe.ch/~scg/Archive/Papers/Scha03aTraits.pdf>:
"Note that because the body of the aliased method is not changed in any way, so an alias to a recursive method is not recursive."

This means that because there is no renaming of anything in the method body when aliased, a recursive call to the method in the trait does not make a recursive call in the aliased method. It will instead call the original method name, which could be the same body, a method defined in a different trait, or the method overridden by the client class.

--
"Joshua Thompson" <[EMAIL PROTECTED]>
<http://www.schmalls.com>

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to