Steve Fink wrote:

In debugging a regex problem, I gradually whittled a test case down to
the following code. It does roughly:

 @a = ('aaa', 'ac');
 $x = $a[0];
 print $x;
 $x = substr("aaacacaaba", 3, 3); # "cac"
 $y = $a[0]
 print $y;

and prints out

  aaa
  cac
This is my illegal speed hack for substr/life.pasm giving roughly 50% more life cycles. Dan did decide, that reusing string headers this way (and giving strings more object like semantics) isn't. String ought to be values (which I don't like, it prohibits effectively reusing string headers)
s. also Subject ~~ "string_set is back"

Anyway:
--- string.c Sat Jan 4 11:00:13 2003
+++ /opt/src/parrot-leo/string.c Fri Jan 24 20:17:06 2003
@@ -624,7 +624,7 @@
}

/* do in-place i.e. make a COW string */
-#if 1
+#if 0
dest = string_set(interpreter, *d, src);
#else
dest = make_COW_reference(interpreter, src);

leo

Reply via email to