Subject: | Make C<< has "thing"; >> DWIM |
I figure this would DWIM.
package Foo;
has "thing";
my $foo = Foo->new( thing => 42 );
$foo->thing;
but no accessor was generated. jrockway on #moose explained that it
declared an attribute without an accessor, and I understand why they're
differentiated. jrockway also explained the aim was to be explicit, but
if that were so "is" would be a required parameter and you'd have to set
it to "none". As it stands right now the above is a trap as it silently
does an unexpected, fairly obscure (from a new Moose user standpoint) thing.
It would be nice if it DWIM, and WIM is rarely "make me an attribute
without an accessor". I've been writing Moose for 10 minutes and
already I'm sick of writing, C<< is => "rw" >>. Simple Huffman encoding
says that should be the default.