Hi,

Илья wrote:
> Hi,
> no one answered at #perl6, so I sending this question in list:
> 
> ihrd: I have question about attr initialization
> ihrd: if I have two attr with same name
> ihrd: like @.args and %.args
> ihrd: and instance object, like .new(args => {foo => 1}), rakudo init both 
> attr
> ihrd: and question is, how this is should work in perl6?

Not at all.

Note that you *could* have private attributes @!args and %!args, but as
soon as you generate a public accessor you get a conflict (because both
just create a nullary method named 'arg', which can never be called
ordinarily, just things like $obj.+arg() would work).

So the answer seems to be "don't do that".

Cheers,
Moritz

Reply via email to