from src/ops/string.ops:
=item B<substr_r>(out STR, in STR, in INT, in INT)
Make $1 refer to the given part of $2, basically like above, but it
is reusing the given destination string and doesn't care if the
source string is changed later. This I<is changed> includes
also GC runs, which will move the referenced string. This also
means that $1 has to be reset before any GC may happen.
This opcode should really be just used to quickly refer to a substring of
another part, e.g. for printing and is a temporary hack.
B<Handle with care>
=cut
either move this to experimental.ops, or remove it entirely. i vote to
remove it. we don't need temporary hacks as core ops.
~jerry
$ find . -name '*.pir' | xargs grep substr_r
...
./examples/shootout/revcomp.pir: $S0 = substr_r line, i, 60
...
You can blame /me for this one. It was a (speed) hack to be somehow
competitive (or even functional) in this shootout benchmark.
I'd rather have it in experimental.ops until these string issues are resolved.
See also
Re: [perl #37940] substr and memory issues
http://groups.google.at/group/perl.perl6.internals/browse_frm/thread/7b57df47d1cafba5/097808a56675ff13?lnk=gst&q=substr+related+PANIC+&rnum=1#097808a56675ff13
http://groups.google.at/group/perl.perl6.internals/browse_frm/thread/7b57df47d1cafba5/8f1c0d4d07e631ae?lnk=gst&q=shootout+toetsch&rnum=17#8f1c0d4d07e631ae
leo
Move it to experimental.ops, and note it in DEPRECATED.pod.
Allison