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

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

Thread Previous | Thread Next
Nick Ing-Simmons
March 12, 2001 10:03
Re: use bytes; - what does/should it mean?
Message ID:
Simon Cozens <> writes:
>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. :) 

use xxxx gives you access to what the C code does when the xxxx hint
bit is set/cleared.
The C code itself is not mutable at runtime, so that isn't very useful 
(IMHO) unless what the C code does is clearly specified.
Which is essentialy the same as your next paragraph:

>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.

I have no objection in principle to exposing the guts. (I am an XS hacker
by inclination) - what I object to is using 'use bytes' which is 
semi-documented as novice-level perl user thing for that.

If we need a pragma for that then I think we should evolve the _other_ 
internals hack i.e.: 

use unicode::distinct; 

into that access mechanism.

That snag I have right now is that I get a headache trying (for example)
to think through what effect of isIDFIRST_lazy_if()'s IN_BYTE hook has 
on the tokenizer and hence how 

$foo = "\$\N{xxxx} = 42;"
use bytes;
eval $foo;

should behaves on EBCDIC .

Nick Ing-Simmons <>
Via, but not speaking for: Texas Instruments Ltd.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About