develooper Front page | perl.perl6.language | Postings from July 2005

Re: Autogenerated attribute accessor names

Thread Previous | Thread Next
Larry Wall
July 5, 2005 18:08
Re: Autogenerated attribute accessor names
Message ID:
On Tue, Jul 05, 2005 at 05:26:31PM -0400, Stevan Little wrote:
: What should I do when I encounter two attributes which can peacefully co-exist as 
: attributes, but cause a class when we autogenerate the accessors for them. Here is a 
: quick example:
: class Foo {
: 	has;
: 	has $.bar;
: }

Probably for now we should do the conservative thing and carp as
soon as we notice it, much like for role method conflicts.  We could
relax that later if we find a decent way to disambiguate, but I don't
think there will be great demand for it.  In any event, as with role
conflicts, if they write their own method, it overrides both of them
anyway and they can figure it out them own selves.  If we pretend
attribute declarations are anonymous role declarations, they might
turn out to be just that, especially if we decide it's a useful conceit.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About