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
From:
Nicholas Clark
Date:
July 11, 2011 05:46
Subject:
Re: Why views are useful, and why their syntax doesn't matter much
Message ID:
20110711124619.GB23881@plum.flirble.org
On Thu, Jul 07, 2011 at 05:31:48PM +0200, Leon Timmermans wrote:
> On Thu, Jul 7, 2011 at 4:43 PM, Nicholas Clark <nick@ccl4.org> wrote:
> >> Which is exactly what it currently does.
> >
> > Except not quite, as restricted hashes let you delete their keys.
> 
> I meant, that's exactly what it currently does for arrays.

Two failures of understanding on my part already in this thread. :-(

> > I'm starting to think that the least insane solution to this *is* a general
> > purpose vtable interface for hashes, and a general purpose vtable interface
> > for arrays, and then implement tie (and all the other existing funky stuff)
> > with that.
> 
> I started writing that once for arrays, but my previous code has
> significant bitrot and I probably should start all over. There are
> some tricky cases to it though, as always.

Even just publishing an explanation of the problem areas would be really
useful.

> > It would then give the flexibility to do other stuff well, such as decently
> > sparse arrays, and (I think) Reini's proposed typed arrays.
> 
> Yeah. It's obviously useful, and currently having to using ties for
> that kind of stuff simply sucks balls.

Indeed. Slowly. Setting up a Perl call environment just to call some XS code
is two levels of conversion you didn't want.

Nicholas Clark

Thread Previous


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