Re: Traits and Properties
| From: | Stefan Marr | Date: | Mon, 03 Jan 2011 08:50:28 +0000 |
| Subject: | Re: Traits and Properties | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-51205@lists.php.net to get a copy of this message | ||
Hi Ben:
On 03 Jan 2011, at 06:58, Ben Schmidt wrote:
> I'm a latecomer here, but...
>
> Stefan, doesn't this conflict with what you've written here (and the
> test cases in SVN)?:
>
>
> http://wiki.php.net/rfc/horizontalreuse#handling_of_propertiesstate
>
> Or is what is happening here that the properties in traits are treated
> essentially as declarations rather than definitions, triggering errors
> but not actually creating properties, and you think they should actually
> create properties?
Sorry, I do not understand.
Is the text in the RFC contradicting or not clear enough about what the test cases show?
The intention was to provide the developer with hints when it is possible that state is
incompatible.
Until now, the reason why there is not fancy mechanism for conflict resolution for properties in
traits is, first, the dynamic nature of PHP which makes certain things like 'renaming'
inconsistent with the rest of the language, especially its meta-programming facilities, and second,
the added problem with state, that you actually have many usecases where the state needs to be
merged. However, merging behavior is not possible, which simplifies the language constructs for
handling behavioral conflicts.
Best regards
Stefan
--
Stefan Marr
Software Languages Lab
Vrije Universiteit Brussel
Pleinlaan 2 / B-1050 Brussels / Belgium
http://soft.vub.ac.be/~smarr
Phone: +32 2 629 2974
Fax: +32 2 629 3525