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:18
Subject:
Re: [PATCH] Add a 'qr' overload type
Message ID:
20091028091803.GH60303@plum.flirble.org
On Wed, Oct 28, 2009 at 10:11:13AM +0100, demerphq wrote:
> 2009/10/28 Nicholas Clark <nick@ccl4.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.
> 
> Do you recall what might need to be done?

It might be as "simple" as

0: See what the APIs documented in maint-5.10 are
1: Find the prototypes of those functions in maint-5.10
2: Find the prototypes of the functions with the same names in blead
3: Figure out how complex the changes are
4: Update the documentation on the obviously simple changes
5: Punt on the rest

I'm not sure if there's complication because the type of structure changed
from C<struct regexp> to pointer-to-SV which in turn points to a
C<struct regexp> (where those are somewhat different C<struct regexp>s)

But in turn, I'm not sure how much of those changes were hidden by the macros
I wrote, which didn't exist back when Avar did all the work back before 5.10

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