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

Re: PARROT QUESTIONS: Keyed access

Thread Previous | Thread Next
From:
John Porter
Date:
July 20, 2002 22:56
Subject:
Re: PARROT QUESTIONS: Keyed access
Message ID:
20020721055623.58899.qmail@web10806.mail.yahoo.com

Ashley Winters wrote:
> $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.

You've said what I tried to say, exactly.


> I don't see much use for set_p_[is]_*, . . .

Yep, cool.

I guess the problem I have with the approaches proposed so far
is that they suppose a special key type.  I don't particularly
care if the op is called set_p_kp_* as long as the second p is
not in fact required to be some special key type.  It could be
just any type whose value could be construed (by a compound
type pmc) as an index.  In the simple cases, as an integer by
an array pmc and as a string by a hash pmc; in more complex
case, as a vector of indices by a multi-dim array.
Point is, a int/string/array pmc used that way need not
support any different vtable methods than plain ol'
int/string/array.

Right?  Or am I overlooking something?

-- 
JohnDouglasPorter


__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

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