petdance/scratch — Issue #1082: set_string_native() not implemented in class 'TclString'
Author: petdance
Created: 2011-11-14 06:14:37+00:00
State: open
Labels: bug, Pri-critical, Sev-fatal

This error has cropped up in the last few months in partcl-nqp. (No changes in partcl, just upgrading parrot was sufficient to gen the error)
In one case, there was a concat operation in our src/Partcl/commands/time.pm ; prefixing the first element with a ~ avoided the error. (but should have been unnecessary.)

There is another location where this error occurs, triggered by the following tcl:

```
$ cat error.tcl
for {set i 0} {$i < 2} {set i [expr $i+1]} {puts $i}
$ ./partcl error.tcl
0
1
set_string_native() not implemented in class 'TclString'
while executing
eval
(file "" line 7)
for
(file "" line 12)
HLL::Compiler::eval
(file "" line 151)
PCT::HLLCompiler::evalfiles
(file "" )
PCT::HLLCompiler::command_line
(file "" )
main
(file "" line 1)
```

In eval (src/Partcl/commands/eval.pm) the error is occurring when invoking the sub generated by:

```
my &sub := Partcl::Compiler.compile($code);
&sub(); #BOOM
```

In any case, TclString should in fact have a set_string_native, inherited from its parent class of String; it's declared in an nqp file as:

```
class TclString is String
```

Originally http://trac.parrot.org/parrot/ticket/1886 by @coke