[perl #41749] [TODO] deprecate substr_r op

0 views
Skip to first unread message

Jerry Gay

unread,
Mar 8, 2007, 2:25:38 PM3/8/07
to bugs-bi...@rt.perl.org
# New Ticket Created by Jerry Gay
# Please include the string: [perl #41749]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=41749 >


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

Leopold Toetsch

unread,
Mar 8, 2007, 4:17:53 PM3/8/07
to perl6-i...@perl.org
Am Donnerstag, 8. März 2007 20:25 schrieb Jerry Gay:
> either move this to experimental.ops, or remove it entirely. i vote to
> remove it. we don't need temporary hacks as core ops.

$ 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

Allison Randal

unread,
Mar 13, 2007, 3:47:58 PM3/13/07
to Leopold Toetsch, perl6-i...@perl.org
Leopold Toetsch wrote:
> Am Donnerstag, 8. März 2007 20:25 schrieb Jerry Gay:
>> either move this to experimental.ops, or remove it entirely. i vote to
>> remove it. we don't need temporary hacks as core ops.
> [...]

> I'd rather have it in experimental.ops until these string issues are resolved.

Move it to experimental.ops, and note it in DEPRECATED.pod.

Allison

Reply all
Reply to author
Forward
0 new messages