I want a ArrayRefish type that acts like Object::Array, and maybe a HashRefish type that acts like Object::Hash. I want to be able to push and splice my arrays, this sucks:
push @{ $object->relatives }, $value;
MXAH doesn't make it much better, in my opinion:
$object->push_relatives, $value;
Sure, there's no ugly syntax, but now I have one method per (op x attr), and I
probably have to set those up manually more often than I want.
I'd rather type:
$object->relatives->push($value);
Heck, with this I can even (mostly) keep an auto_deref-like behavior by
returning that sort of value when called in list context, since all the method
calls will be imposing scalar context. This will be weird:
my $scalar = $object->relatives;
...but I don't mind relying on social pressure and the plurality of the
attribute name to force me to pay more attention.
Obviously, these should be able to auto-upgrade from stock $whatever references
when set.
--
rjbs
pgpXNY4g7LZ37.pgp
Description: PGP signature
