develooper Front page | perl.perl6.internals | Postings from July 2002

Re: PARROT QUESTIONS: Keyed access

Thread Previous | Thread Next
From:
Ashley Winters
Date:
July 20, 2002 18:30
Subject:
Re: PARROT QUESTIONS: Keyed access
Message ID:
200207210131.14353.qaqortog@nwlink.com
On Saturday 20 July 2002 07:49 pm, John Porter wrote:
> Brent Dax wrote:
> > set P0[P1], P2
> > set P0, P1[P2]
> >
> > What do you do about that?
>
> Disallow the latter.  As a single op, that is.
> Decompose into a get from P1 and a set into P0.

I would argue against that. Store operations can afford to be cumbersome, but 
fetching should do any optimizations that can be made to stick. That's why we 
do hashing in the first place, after all.

$foo{$x}{$y}{$z} = 10;

set P0, P0[P1]
set P0, P0[P2]
set P0[P3], P4

That code assumes the KEY* goes away, which I would like. Just don't allow 
more than one keyed parameter.

set P0[P1], P2[P3]

That's madness.

I don't see much use for set_p_[is]_*, since that would just mean the hash PMC 
class would have to provide a default hashing algorithm instead of being able 
to rely on $1->vtable->hash() (or whatever) always being available. I 
sincerely hope that's how hashing PMCs is going to work, at least. :)

Ashley Winters

-- 
When you do the community's rewrite, try to remember most of us are idiots.


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