This code is not working in Tcl at the moment (at the moment, not
sure if it ever did)
set a [list a b]
set a b
Under the covers, this should create a TclList PMC and assign it to
the global '$a'. It should then discard that value, and replace the
value in '$a' with a String of "b".
However, running this errors with:
"Can't set self from this type"
This error appears in one place in the parrot code base, in
Parrot_ResizablePMCArray_set_integer_native.
I'm trying to figure out how the assign statement that does the swap
(from a trace output)
19552 assign P0, P1 P0=TclList=PMC(0x1cf0640)
P1=String=PMC(0x1cf04f0 Str:"b")
Ends up with the following backtrace:
#0 Parrot_ResizablePMCArray_set_integer_native
(interpreter=0xe00420, pmc=0x28191e8, size=1) at src/pmc/
resizablepmcarray.pmc:40
#1 0x00266090 in Parrot_ResizablePMCArray_push_pmc
(interpreter=0xe00420, pmc=0x28191e8, value=0x28191b8) at src/pmc/
resizablepmcarray.pmc:357
#2 0x0010c35c in new_hll_entry (interpreter=0xe00420) at src/hll.c:93
#3 0x0010c500 in Parrot_register_HLL (interpreter=0xe00420,
hll_name=0xbb9f48, hll_lib=0x0) at src/hll.c:123
#4 0x000b25bc in parrot_global_setup_2 (interpreter=0xe00420) at src/
global_setup.c:172
#5 0x00226778 in Parrot_initialize_core_pmcs (interp=0xe00420) at
src/core_pmcs.c:162
#6 0x000b23d0 in init_world (interpreter=0xe00420) at src/
global_setup.c:125
#7 0x0001a0dc in Parrot_init (interpreter=0xe00420) at src/embed.c:87
#8 0x000188d8 in make_interpreter (parent=0x0,
flags=PARROT_NO_FLAGS) at src/inter_create.c:167
#9 0x0001a084 in Parrot_new (parent=0x0) at src/embed.c:48
#10 0x00004ce4 in main (argc=4, argv=0xbffff794) at compilers/imcc/
main.c:509
Why is assign calling push_pmc?
And, why is RPA missing 'assign_pmc' (found in the plain ole Array) ?
(Though adding this to RPA in my sandbox didn't help.)
languages/tcl/t/tcl_misc.t#27 has a test for this behavior.
Any ideas?
--
Will "Coke" Coleda
[EMAIL PROTECTED]