Re: Instance attributes collision

2006-02-15 Thread Stevan Little
On 2/15/06, Rob Kinyon <[EMAIL PROTECTED]> wrote: > On 2/14/06, Stevan Little <[EMAIL PROTECTED]> wrote: > > I think that the metaclass (stored in the pseudo-lexical $::CLASS) > > should create a number of anonymous roles on the fly: > > > >role { > > multi method a (::CLASS $self) { ..

Re: Instance attributes collision

2006-02-15 Thread Rob Kinyon
On 2/14/06, Stevan Little <[EMAIL PROTECTED]> wrote: > I think that the metaclass (stored in the pseudo-lexical $::CLASS) > should create a number of anonymous roles on the fly: > >role { > multi method a (::CLASS $self) { ... } > multi method a (::CLASS $self, Scalar $value) {

Re: Instance attributes collision

2006-02-14 Thread Stevan Little
On 2/12/06, Yiyi Hu <[EMAIL PROTECTED]> wrote: > For perl 6, > Array and Scalar are in different namespace. > So, > class A { has $.a; has @.a }; > > what will A.new.a return by default? > > An Error? or Scalar has a higher priority? It seems to me that the best way to approach this issue is to s

Re: Instance attributes collision

2006-02-13 Thread Juerd
Luke Palmer skribis 2006-02-13 9:46 (+): > class Baz { > does Foo; > does Bar; # does this count as double declaration? > } I'd put composition and inheritance in a slightly different category than accessor *generators*. Juerd -- http://convolution.nl/maak_juerd_bl

Re: Instance attributes collision

2006-02-13 Thread Luke Palmer
On 2/13/06, Juerd <[EMAIL PROTECTED]> wrote: > Luke Palmer skribis 2006-02-13 9:36 (+): > > That's a compile time error. Both "has" declarations generate a > > method "a", so it is a method conflict. > > Doesn't normally double declaration end in the later masking/overriding > the earlier dec

Re: Instance attributes collision

2006-02-13 Thread Juerd
Luke Palmer skribis 2006-02-13 9:36 (+): > That's a compile time error. Both "has" declarations generate a > method "a", so it is a method conflict. Doesn't normally double declaration end in the later masking/overriding the earlier declaration, with a warning, but not an error? I'd expect

Re: Instance attributes collision

2006-02-13 Thread Luke Palmer
On 2/13/06, Yiyi Hu <[EMAIL PROTECTED]> wrote: > For perl 6, > Array and Scalar are in different namespace. > So, > class A { has $.a; has @.a }; > > what will A.new.a return by default? That's a compile time error. Both "has" declarations generate a method "a", so it is a method conflict. Luke

Re: Instance attributes collision

2006-02-12 Thread chromatic
On Sunday 12 February 2006 17:11, Yiyi Hu wrote: > For perl 6, > Array and Scalar are in different namespace. > So, > class A { has $.a; has @.a }; > > what will A.new.a return by default? > > An Error? or Scalar has a higher priority? Seems like a compile-time warning (at least) to me. -- c

Instance attributes collision

2006-02-12 Thread Yiyi Hu
For perl 6, Array and Scalar are in different namespace. So, class A { has $.a; has @.a }; what will A.new.a return by default? An Error? or Scalar has a higher priority? Thanks, xinming