develooper Front page | perl.perl5.porters | Postings from January 2012

Re: normalization filters?

Thread Previous | Thread Next
From:
Leon Timmermans
Date:
January 16, 2012 05:04
Subject:
Re: normalization filters?
Message ID:
CAHhgV8jDrLKOnBRY2AndaWup5MXnMdvR2FH4SNmmto_WtQeo_Q@mail.gmail.com
On Wed, Jul 20, 2011 at 11:58 PM, Eric Brine <ikegami@adaelis.com> wrote:
> I started writing one pure Perl version (using PerlIO::via) a while back.
> Should be easy right? ha!
>
> It lead to improvements to Unicode::Normalize (addition of
> C<normalize_partial> and some doc improvements), but I stalled when I found
> that PerlIO::via didn't provide access to a crucial facility available to XS
> PerlIO layers. Specifically, PerlIO::via doesn't provide the ability to peek
> into the buffer of the previous layer. IIRC, without that facility,
> PerlIO::via layers cannot process input as it comes in and must wait for
> EOF. I never got around to adding the functionality to PerlIO::via.
>
> I'll dig up what I have tonight.

What it really needs is not so much a peek ability, but a
read-and-give-up ability. Currently in PerlIO, when you try to
PerlIO_read X bytes, it will loop reading until you have X
bytes/characters, instead of returning what it has an letting the rest
be. Peeking into the buffer is currently the only way to implement the
latter, but it shouldn't be IMHO.

Leon

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