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

[PATCH] Implement Perl 6's // operator

Thread Next
From:
Brent Dax
Date:
April 21, 2002 23:01
Subject:
[PATCH] Implement Perl 6's // operator
Message ID:
000a01c1e9c3$43821e60$9865fea9@deepblue
The attached patch (at ~14K) implements Perl 6's new C<//>, C<//=>, and
C<err> ops for Perl 5.  It includes tests, a patch to perlop, and a
patch to B::Deparse.  It also modifies several areas of Perl, including
the parser and tokenizer, and adds two new opcodes.

I was originally going to include patches to both the source and
generated versions of several files (e.g. perly.y and perly.c), but the
patch was 300K when I did that, so you'll need to be able to regenerate
the parser and the opcode table to use this.

Tests come out like this:

Failed Test               Stat Wstat Total Fail  Failed  List of Failed
------------------------------------------------------------------------
-------
...\ext/Encode/t/perlio.t     7  1792    20    7  35.00%  1-2 5-6 10 14
18
...\ext/threads/t/end.t                   6    4  66.67%  3-6
...\lib/ExtUtils/t/Embed.t                9    9 100.00%  1-9
io/fs.t                                 36    8  22.22%  2-5 7-9 11
op/stat.t                               73    2   2.74%  5 7
51 tests and 570 subtests skipped.
Failed 5/679 test scripts, 99.26% okay. 30/63549 subtests failed, 99.95%
okay.

I'm assuming that that's normal for Win32.

I have no expectation that this will be in 5.8, and only a very slightly
higher expectation that it'll be in 5.10.  I wrote this as much to
figure out how to do stuff in Perl internals as to make a contribution
to the language.

Finally, this is my first attempt to do anything with the Perl 5 core,
so comments on style, etc. would be appreciated.

Thanks.
--Brent Dax <brentdax@cpan.org>
@roles=map {"Parrot $_"} qw(embedding regexen Configure)

#define private public
    --Spotted in a C++ program just before a #include

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