According to Larry Wall:
> I don't claim to follow all this talk about "stores"

Think about tied values.  When does STORE get called, precisely, on a
tied target of s///?  It's good to be explicit about this, down at the
C API level, just so we know what to optimize for.  The final answer
is probably less interesting than the discussion that illuminates it.

> In an example like
>     ($a = $genome) ~~ s/TTAGGG//
> you'd like to capture the idea that there's already a copy being forced
> in the context, so it'd be nice to use that copy to do the transformation
> without inducing an additional copy.

That's true and worth doing, but it's beside my intended point.  Mea
culpa: I combined the assignment with the substitution to make the
example a one-liner, and thus muddied it.  The s/// is the topic.

> There are also optimization modes where a single substitution like
>     $genome ~~ s/TTAGGG//
> can be done "mostly in place".

Indeed, I had that in mind when I designed Topaz's "open the hood"
feature for string Scalars, which I mentioned earlier as a possible
model for optimizing s/// on normal strings while giving well-defined
semantics to s/// on abnormal strings.
-- 
Chip Salzenberg         - a.k.a. -        <[EMAIL PROTECTED]>
  "Persistence in one opinion has never been considered
  a merit in political leaders." --Marcus Tullius Cicero

Reply via email to