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

Re: Objects without stashes?

Thread Previous | Thread Next
Jesse Luehrs
July 12, 2012 20:43
Re: Objects without stashes?
Message ID:
On Thu, Jul 12, 2012 at 08:09:31PM -0700, Rev. Chip wrote:
> On Fri, May 25, 2012 at 04:47:17PM +0200, Leon Timmermans wrote:
> > I hate the way classes/objects work. In particular, I think stashes of
> > globs of other stuff is paradigm that fails ...
> At the micro change level, how about just allowing arbitrary hash refs as
> stashes?  Seems like any self-respecting MOP would need that anyway, and
> it's a useful feature for anyone doing mixins.

On the one hand, any implementation of a MOP that actually works well is
not going to have any interaction with stashes at all (the indirection
of going through typeglobs is unnecessary and just slows things down and
complicates things for no reason - all MOP-based classes would need is a
map of methods).

On the other hand, the core already basically supports this right now,
since nearly every interaction with stashes already is through HV*s,
rather than names (see Package::Anon for how little extra support really
is needed). I don't see any reason why this couldn't be officially
supported with very little effort or downsides.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About