At 9:03 AM +0200 9/16/02, Leopold Toetsch wrote:
>Ken Fox wrote:
>
>>Dan Sugalski wrote:
>
>>>On lookup. The aggregate being queried by key is responsible for 
>>>complaining if the key its passed is something that it doesn't 
>>>like.
>>
>>
>>If %h{"a"}[0][1] is a PASM P2["a";0;1], then what is %h{"a"}{0}{1}?
>>
>>It can't be the same thing, because then we lose the distinction
>>between hash and array lookups. (I think this is where the type
>>checking confusion is.)
>
>
>In PASM they look the same. But as Dan stated, and as tried to show 
>in my answer to Graham, the lookup succeeds only if the nested PMCs 
>are all of the correct type. This works now because an array doesn't 
>support a string as key, while a perlhash doesn't support an int as 
>key.
>
>So the wrong types will produce either "Not a string!" or "Not an integer!".

I've been thinking that we do need to have an extra flag to note 
whether a key element should be taken as an array or hash lookup 
element. The integer 1 isn't quite enough, since someone may have 
done a %foo{1} and we only have that in as an integer key.
-- 
                                         Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                       teddy bears get drunk

Reply via email to