in reply to Re^6: Perl OO and accessors
in thread Perl OO and accessors

C’mon now, what do you expect me to say? Don’t use Perl5 OO? :-)

Wait. Perl6 is right around the corner.

Or maybe… Have you heard of Ruby?

Seriously, though, things like Tie::Constrained take most of the pain away. Sure, I’d rather there was a better way, too. In any case, as a user of APIs with lvalue accessors I quite liked them; I haven’t so far actually designed an API with lvalue subs myself, however.

Basically, the ugliness involved in lvalue accessors is just one more thing that makes me go “okay, I have appreciated the beauty and elegance in Perl5’s ultra-minimal OO approach enough, but now I’d like to get some real work done.”

But all these considerations apply to the hidden end of an API. From the public side, lvalue accessors have no downsides whatsoever. They don’t expose anything untoward. That’s what I was arguing.

Makeshifts last the longest.