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

Re: Intlist question

Thread Previous
From:
Steve Fink
Date:
October 13, 2002 23:14
Subject:
Re: Intlist question
Message ID:
20021014061241.GB2030@foxglove.digital-integrity.com
On Sun, Oct 13, 2002 at 11:43:23PM -0400, Simon Glover wrote:
> 
>   I've just tried to write PASM like:
> 
>     new P0, .IntList
>     new P1, .PerlInt
> 
>     set P1, 20
>     set P0[0], P1
>     ...
>     end
> 
>   only to have it fail with the message:
> 
>    'Subscript on something that's not an aggregate!'
> 
>   Is this a bug or a feature?

Was that before or after the big PMC reorganization commit?

I get something similar. If I run the above code, I get

  get_integer_keyed() not implemented in class 'PerlInt'

However, if I run the same code with tracing enabled, I get

  get_number() not implemented in class 'IntList'

I'll try to take a look at it soon, unless somebody else beats me to
it (please?). When I implemented the IntList PMC, I didn't bother to
implement every variation of the different vtable entries, partly from
laziness and partly because I expected the PMC hierarchy to change so
I might not need to. However, that wouldn't explain any of the above
errors.

Oh, I see why the behavior changes with tracing: fairly recently, I
committed someone's patch (Brent Dax, I think) that makes it print out
PMCs during tracing by printing their pointer, string, number, and
integer values. That's more likely to cause a problem now that many
more operations throw exceptions when you try to call an unimplemented
vtable entry (such as get_number on an IntList).

Probably that should be fixed by trapping exceptions when dumping a
PMC? As soon as exceptions are designed and implemented, that is.

Ok, so that narrows it down to the "get_integer_keyed" thing.

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