Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #40122] [TODO] list_splice should work on any pmc that 'does array'

6 views
Skip to first unread message

Will Coleda

unread,
Aug 8, 2006, 2:53:14 PM8/8/06
to bugs-bi...@rt.perl.org
# New Ticket Created by Will Coleda
# Please include the string: [perl #40122]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=40122 >


There is a lot of defensive code around the splice vtable list_splice
() function that prevents using it across multiple types of PMCs.

This should be removed, and we should be able to splice any two array
types together. If necessary, throw an exception when trying to
splice a fixed-size array.

--
Will "Coke" Coleda
wi...@coleda.com


Leopold Toetsch

unread,
Aug 8, 2006, 3:40:12 PM8/8/06
to perl6-i...@perl.org
Am Dienstag, 8. August 2006 20:53 schrieb Will Coleda:

> There is a lot of defensive code around the splice vtable list_splice
> () function that prevents using it across multiple types of PMCs.
>
> This should be removed, and we should be able to splice any two array
> types together. If necessary, throw an exception when trying to
> splice a fixed-size array.

The list_splice is an optimized implementation for Array (or any list based
array). If you need a more general solution you can just implement the splice
vtable function in the TclList PMC (or prefered in the RPA.pmc, where it's
missing).

BTW:

pmclass TclList extends ResizablePMCArray need_ext does array dynpmc group
tcl_group hll Tcl maps Array {

doesn't make much sense:

- extends ResizablePMCArray means, that it is inheriting from that (C-wise)
- maps Array means, that if, Parrot should create an array type, which is
HLL-dependent, it should use C<Array>.

Array is in internals list-based and not compatible with RPA. These different
array types don't work together at all.

leo

Will Coleda

unread,
Aug 8, 2006, 4:44:56 PM8/8/06
to parrotbug...@parrotcode.org

On Aug 8, 2006, at 3:40 PM, Leopold Toetsch via RT wrote:

> Am Dienstag, 8. August 2006 20:53 schrieb Will Coleda:
>
>> There is a lot of defensive code around the splice vtable list_splice
>> () function that prevents using it across multiple types of PMCs.
>>
>> This should be removed, and we should be able to splice any two array
>> types together. If necessary, throw an exception when trying to
>> splice a fixed-size array.
>
> The list_splice is an optimized implementation for Array (or any
> list based
> array). If you need a more general solution you can just implement
> the splice
> vtable function in the TclList PMC (or prefered in the RPA.pmc,
> where it's
> missing).
>

Ah. Didn't realize this was tied so intimately to the internal
structure of Array.
Closing ticket...

> BTW:
>
> pmclass TclList extends ResizablePMCArray need_ext does array
> dynpmc group
> tcl_group hll Tcl maps Array {
>
> doesn't make much sense:
>
> - extends ResizablePMCArray means, that it is inheriting from that
> (C-wise)
> - maps Array means, that if, Parrot should create an array type,
> which is
> HLL-dependent, it should use C<Array>.
>
> Array is in internals list-based and not compatible with RPA. These
> different
> array types don't work together at all.
>
> leo

Opened another ticket regarding this so tcl can follow the rules.

0 new messages