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

Re: Next API question for Devel::PPPort

Thread Previous
From:
H.Merijn Brand
Date:
October 23, 2008 12:19
Subject:
Re: Next API question for Devel::PPPort
Message ID:
20081023211943.4e5da7fb@pc09.procura.nl
On Thu, 23 Oct 2008 19:41:24 +0200, Marcus Holland-Moritz
<mhx-perl@gmx.net> wrote:

> On 2008-10-23, at 16:19:00 +0200, H.Merijn Brand wrote:
> 
> > Can I haz Perl_pv_pretty () and Perl_pv_escape () in Devel::PPPort?
> 
> Patches welcome. :-)
> 
> No, really, pulling these in will be quite some work, as it's
> not as easy as copying and pasting the functions. Currently
> they depend on a couple of UTF8 functions, which I'm reluctant
> to pull in simply because of their cumulative size.
> 
> I guess you know these functions far better than I do (I wasn't
> even aware they existed),

Neither did I till this morning when I was unhappy with pv_display ()
not showing UTF-8 as UTF-8, so I moved up to pv_pretty (), but I was
developing on 5.10.0 and found out it didn't work on 5.8.8 :(

It's just another step into my Yak-shaving the API. Why doesn't perl
export functions that are in the public API. Then I start testing,
writing tests, expand Data::Peek with the newly detected API
functionality and find out it doesn't work on `older' perls.

> so it'll be much easier for you to rewrite them without the UTF8
> stuff and to write tests for them than it would be for me.

Maybe.

> If you can provide me with a new file that I can put into
> parts/inc/ that implements both functions (as stripped down
> and de-utf8'ed as possible), along with proper tests, I'll
> be happy to integrate it and do the usual backwards compat
> testing (and if necessary fixing).
> 
> You can have a look at the implementation of newSVpvn_flags
> in parts/inc/newSVpv. I guess a copy of that file would make
> a good starting point.
> 
> Marcus
> 
> > $ grep -P '\bpv_' ppport.h
> > pv_display||5.006000|
> > pv_escape||5.009004|
> > pv_pretty||5.009004|
> > pv_uni_display||5.007003|
> > 
> > $ grep PERL_PV perl.h
> > #define PERL_PV_ESCAPE_QUOTE        0x0001
> > #define PERL_PV_PRETTY_QUOTE        PERL_PV_ESCAPE_QUOTE
> > #define PERL_PV_PRETTY_ELLIPSES     0x0002
> > #define PERL_PV_PRETTY_LTGT         0x0004
> > #define PERL_PV_ESCAPE_FIRSTCHAR    0x0008
> > #define PERL_PV_ESCAPE_UNI          0x0100
> > #define PERL_PV_ESCAPE_UNI_DETECT   0x0200
> > #define PERL_PV_ESCAPE_ALL          0x1000
> > #define PERL_PV_ESCAPE_NOBACKSLASH  0x2000
> > #define PERL_PV_ESCAPE_NOCLEAR      0x4000
> > #define PERL_PV_ESCAPE_RE           0x8000
> > #define PERL_PV_PRETTY_NOCLEAR      PERL_PV_ESCAPE_NOCLEAR
> > #define PERL_PV_PRETTY_DUMP  PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_QUOTE
> > #define PERL_PV_PRETTY_REGPROP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_LTGT|PERL_PV_ESCAPE_RE

-- 
H.Merijn Brand          Amsterdam Perl Mongers  http://amsterdam.pm.org/
using & porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,
11.11, 11.23, and 11.31, SuSE 10.1, 10.2, and 10.3, AIX 5.2, and Cygwin.
http://mirrors.develooper.com/hpux/           http://www.test-smoke.org/
http://qa.perl.org      http://www.goldmark.org/jeff/stupid-disclaimers/

Thread Previous


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