develooper Front page | perl.perl5.porters | Postings from April 2007

[PATCH (incomplete)] Make regcomp use SV* sv, instead of char* exp, char* xend

Thread Next
From:
Ævar Arnfjörð Bjarmason
Date:
April 18, 2007 18:17
Subject:
[PATCH (incomplete)] Make regcomp use SV* sv, instead of char* exp, char* xend
Message ID:
51dd1af80704181817p4ea71f9anba7fa4238280b63@mail.gmail.com
This incomplete patch changes the regcomp prototype so that it always
gets passed SV*. The stringification of objects such as qr// is then
done inside the engine rather than by perl. This allows for passing
regexp objects instead of just a string.

It passes all tests but is incomplete because the code around what was
exp/xend has to be cleaned up. I thought I'd post this for discussion
before I fell asleep, expect a follow-up patch.

I'm going to do the same for regexec too. When it's getting passed a
scalar it will be possible to have C<< $file_hande =~ /^ook/ >> DWIM
in a custom regex engine, of course perl's engine will continue to
blissfully stringify everything.

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