Front page | perl.perl6.language |
Postings from May 2001
RE: properties
Thread Next
From:
Garrett Goebel
Date:
May 22, 2001 08:11
Subject:
RE: properties
Message ID:
71BEC0D4E1DED3118F7A009027B12028703308@EXCH_MISSION
From: Graham Barr [mailto:gbarr@pobox.com]
> On Tue, May 22, 2001, 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 bringing 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.
What I don't understand is why we need properties as yet another layer of
polymorphism enabling pseudo OO-Perl? Why not use the "everything is an
object" paradigm and say that variable and value objects have default
"property" methods that can be called and/or overridden? Hell, why not do
tying by overloading default variable methods while we're at it? Or make
magic accessible to mere demigods by providing something akin to
$foo.value.magic.??? accessors.
What is UNIVERSAL::can($foo, 'new') going to return if there is a variable
and/or value property 'new' set on $foo?
Blurring properties and object methods screws with "\L$object" "\u$class"
method vs. "\L$built" "\u$user" property naming conventions.
To my knowledge, no one has yet proposed how you can clear a user-defined
property on a value?
Thread Next