develooper Front page | perl.perl5.porters | Postings from October 2009

Re: [PATCH] Add a 'qr' overload type

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
October 28, 2009 02:08
Subject:
Re: [PATCH] Add a 'qr' overload type
Message ID:
20091028090848.GG60303@plum.flirble.org
On Tue, Oct 27, 2009 at 03:31:46PM -0500, David Nicol wrote:
> On Tue, Oct 27, 2009 at 11:58 AM, Ben Morrow <ben@morrow.me.uk> wrote:
> 
> > The overload needs to return either a ref to a REGEXP (a qr//) or a bare
> > REGEXP. Any further overloading on the return value will be ignored.
> 
> Is it possible that in the future a coderef that takes the expression
> as its $_[0] and gives the captures as its returned array might be
> acceptable? Just asking what seems like the obvious question.

The regexp engine is intertwined with at least half a dozen perl ops.
It might be possible to write a pluggable regexp engine that accepts code
references conforming to this sort of API, but

a: I don't know how easy it is
b: I changed the regexp API somewhat with the move to first class regexps, and
   left that job only part done, because I didn't update the pluggable API.

Nicholas Clark

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About