On Jul 17, 2008, at 1:56 AM, Moritz Lenz wrote:
Essentially the difference is that smart-match sets $/, while
a simple call to .match probably should not.
Pm
I can have .match not set $/ for now and simply return matches based
on context
IMHO that's the wrong approach. Perl 6 tries not to return stuff based
on context, but to return stuff that will behave right in every
context.
So if you just return a match object (that one that would usually ends
up in $/ ) you should be just fine all contexts.
Moritz
Okay, I'll set it up so "$foo = 'abcd'.match(/<alpha>+/)" returns a
Match object, and $/ would remain unset. Makes sense to me.
Right now the match object is converted over to a Str; I'll take a
look at the parser grammar/actions to see if that can be fixed.
chris