develooper Front page | perl.perl5.porters | Postings from March 2001

Re: use bytes; - what does/should it mean?

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
March 12, 2001 15:17
Subject:
Re: use bytes; - what does/should it mean?
Message ID:
20010312231657.W7731@plum.flirble.org
On Mon, Mar 12, 2001 at 04:33:08PM +0000, Simon Cozens wrote:
> On Mon, Mar 12, 2001 at 03:54:23PM +0000, Nick Ing-Simmons wrote:
> > Right now some it seems some parts of perl do things one way (expose the guts)
> > and some do it the other (take steps to make it "safe"). 
> 
> You see that as a problem; I see it as an opportunity; use bytes makes it an
> option. :) 
> 
> Seriously, the "partial transparency" model that I'm propounding means that
> it's fine to give the end-user Perl-level access to the internal
> representation if we tell her what she's going to get and when. So having "use
> bytes" expose the representation fits in well with that.

OK, so use bytes; gives me SvPV every time at perl level.
How do I get the value of SvUTF8? Else what use is the SvPV if I don't know
which of 2 possible encodings it is?
[which does depend on where the scalar's been, and whether it's a substring
of a UTF8 encoded scalar]

For Nick's 2 suggested options, I believe I prefer "A" - make it "safe"
and behave like there are only 256 possible characters.

This seems more useful to the majority of perl users than exposing the
internals, which (I assume) can always be got by XS if needed by the
minority.

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