On 22.02.2008, at 23:31, Gregory Beaver wrote:

I think you may be confused, because your statement about refactoring is inaccurate - for most methods, there would be no change from the current
proposal.  In other words, in my example above, you could use
trait1::a() simply as Blah::a, for instance:

<?php
$a = new Blah;
$a->a();
?>

Only if one wanted to access trait2::a() would one need to either alias via "function trait2::a as b" to use as "$a->b()" or explicitly refer to
"$a->{'trait2::a'}()"

Ah ok, I thought that trait2::a was the only way to access the trait2 a() method. Ok then its not as problematic. However I do not really like that syntax much. Like I said I also do not like the use of the word "private" in this context. I find it totally confusing, since its not private in the PPP sense. And like I also said before, I am not convinced that traits belong outside of the curly brackets next to the class name and the interface the class may implement. That would make it appear like the trait defines the "type" of the class, which it should not.

So I am still of the opinion that by default all properties/methods should be imported as encapsulated units and the developer can decide which parts of the trait should become visibile to the trait using class.

regards,
Lukas

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

Reply via email to