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:
Leon Timmermans
Date:
July 7, 2011 08:31
Subject:
Re: Why views are useful, and why their syntax doesn't matter much
Message ID:
CAHhgV8gxViEfVmJQHfheMTszmaxum4mHAZ7GXuUTK7wkdRLVFg@mail.gmail.com
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.

> 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.

> 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.

Leon

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