develooper Front page | perl.perl5.porters | Postings from July 2011

Re: Why views are useful, and why their syntax doesn't matter much

Thread Previous | Thread Next
From:
Jesse Luehrs
Date:
July 13, 2011 21:28
Subject:
Re: Why views are useful, and why their syntax doesn't matter much
Message ID:
20110714042808.GJ26428@tozt.net
On Wed, Jul 13, 2011 at 09:20:19PM -0700, Reverend Chip wrote:
> I like them a lot; they're an obvious outgrowth of C<use strict> because
> there's no point in typo checking "$a" but not "$a->{b}".  IMO, it's
> obvious that Moose constructors should lock every object's hash after
> construction (by default at least).  Otherwise there is no detection of
> attribute typos.  Hm, I should write a MooseX for that.

Moose takes the perspective of "you shouldn't ever be touching the
instance structure directly anyway", which means there's nothing *to*
typo (all accessors are generated, so they can't have typos, barring
bugs in Moose). That said, this would be useful to have as a MooseX for
things like conversion of legacy systems.

-doy

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About