Patrick, I would agree with you that saving all the replacements does NOT warrant the overhead. Saving how many matches were made would not be at all heavy overhead, but again, its easy to do in a closure so that too is not really necessary. Just takes awhile to learn how to use the closures.
Thank you, Peter Schwenn On Fri, May 23, 2014 at 4:39 PM, Patrick R. Michaud <pmich...@pobox.com>wrote: > On Fri, May 23, 2014 at 03:08:38PM -0400, Peter Schwenn wrote: > > Still it would be more straightforward to have something like > > $layn ~~ s:g/ (\W) [[RMA\.]? OpenNURBS\.]? I? On (<[2..4]>) dPoint > > /$0Rhino.Geometry.Point$1d/; > > and have a more perl6-built-in way of getting hold of the /replacement/ > and > > the count. > > If it's :g, then wouldn't it be "replacement*s*"? > > The real question to me is whether this is a common enough use case to > warrant the overhead of saving the replacement string(s) for every > s// , or if doing it via closure is sufficient (if a little ugly, but > IMO it's okay for rare to be a little ugly if it means common remains > fast(er) :). > > Pm >