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

Re: Objects without stashes?

Thread Previous | Thread Next
From:
Jesse Luehrs
Date:
July 12, 2012 20:43
Subject:
Re: Objects without stashes?
Message ID:
20120713034301.GD30375@tozt.net
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.

-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