p5-mop-redux icon indicating copy to clipboard operation
p5-mop-redux copied to clipboard

Defining multiple attributes with one "has" statement

Open kraih opened this issue 11 years ago • 2 comments

Might be nice to be able to define multiple attributes with has ($!foo, $!bar);, just like in Perl6, and analogous to my ($foo, $bar);.

kraih avatar Oct 19 '13 19:10 kraih

+1 - I don't see any reason why has and my should be any different in terms of syntax.

doy avatar Oct 19 '13 19:10 doy

I suppose this also implies that the following should work:

has ($!foo, $!bar) = (666, 999);

And then you end up also having to support:

has ($!foo, $!bar) = $self->method_that_returns_a_list;

Argh!

tobyink avatar Nov 19 '13 15:11 tobyink