PMC new init_int, comments and tests welcome

Jonathan Leto jaleto at gmail.com
Thu Mar 11 06:03:25 UTC 2010


Howdy,

More details:

parrot_shell 2> $P0 = new 'FixedStringArray', 5
say $P0
.
Time: 0.0164859 wallclock secs
Output:
[ "", "", "", "", "" ]

parrot_shell 3> $P0 = new ['FixedStringArray'], 5
say $P0
.
Error: child exited with value 1
Time: 0.0155749 wallclock secs
Output:
init_pmc() not implemented in class 'FixedStringArray'
current instr.: 'main' pc 0
(/var/folders/B3/B3qJ-edQFWKuziEWXxoYbU+++TI/-Tmp-/uqxyEgMOVK:3)

So it seems that tewk++'s patch works for string constants, but not
key constants.

I will investigate further.

On Wed, Mar 10, 2010 at 1:08 AM, Jonathan Leto <jaleto at gmail.com> wrote:
> Howdy,
>
> This test:
>
> .sub 'test_new_style_init'
>    $P0 = new ['FixedIntegerArray'], 10
>
>    $I0 = $P0
>    is($I0, 10, "New style init creates the correct # of elements")
> .end
>
> generates this error:
>
> init_pmc() not implemented in class 'FixedIntegerArray'
> current instr.: 'test_new_style_init' pc 133 (t/pmc/fixedintegerarray.t:39)
> called from Sub 'main' pc 128 (t/pmc/fixedintegerarray.t:34)
>
> Duke
>
>
> On Tue, Mar 9, 2010 at 6:33 PM, Kevin Tew <tewk at tewk.com> wrote:
>> Its in,
>>
>> I had to make realclean.
>>
>> Kevin
>>
>> Jonathan Leto wrote:
>>>
>>> Howdy,
>>>
>>> +1 to this patch
>>>
>>> I can write tests for it when it gets applied.
>>>
>>> Duke
>>>
>>>
>>> On Tue, Mar 9, 2010 at 4:40 PM, Kevin Tew <tewk at tewk.com> wrote:
>>>
>>>>
>>>> 14:02 < whiteknight> would like to add a new VTABLE_init_int, which would
>>>> allow initialization from an integer
>>>> 14:03 < whiteknight> Would allow preallocation of things like
>>>> Fixed*Array,
>>>> Integer, CallContext, etc
>>>> 14:04 < whiteknight> Coke: you would have to create a throwaway Integer
>>>> PMC
>>>> to do the same thing
>>>> 14:07 < Coke> NotFound: new $P1, ['Array'],  5
>>>> 14:07 < allison> I am in favor or ways to avoid creating intermediate
>>>> throw-away PMCs
>>>> 14:07 < whiteknight> $P0 = new ['FixedIntegerArray'], 10
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> http://lists.parrot.org/mailman/listinfo/parrot-dev
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>
>>
>
>
>
> --
> Jonathan "Duke" Leto
> jonathan at leto.net
> http://leto.net
>



-- 
Jonathan "Duke" Leto
jonathan at leto.net
http://leto.net


More information about the parrot-dev mailing list