On Tue, May 22, 2001 at 12:29:33PM +1000, Damian Conway wrote:
>    > if so, then wouldn't it be safer to put properties inside a special object
>    > associated with each object (the 'traits' object) so there would be little
>    > namespace collision?
> 
> We actually want the possibility of that kind of namespace collision:
> for polymorphism.

Many people keep bringig this up as a confusion and you give the same reply.

However there has not yet, AFAIK, been any description of how having a method
overload a property is useful.

If there is some compelling reason that this is a must, then fine. But many
people seem to be finding this a point of confusion.

Personally I don't see that the gain is greater than the confusion. I would
rather see properties be accessed via a different operator other than dot (.)

If a class wants to manipulate a property via a method they still can, the user
just has to call the method instead of accessing the property directly

With the current approach I can see most code accessing properties with $var.prop{name}
because they want to make sure they get the property and not a method, whereas
it would be shorter, in the common case, to have something like  $var'name

Graham.

Reply via email to