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

Re: evalbytes

Thread Previous
From:
Father Chrysostomos
Date:
October 31, 2011 13:21
Subject:
Re: evalbytes
Message ID:
E2A265FE-4AB7-4970-85CE-FB292C662462@cpan.org

On Oct 31, 2011, at 10:30 AM, Brian Fraser wrote:

> On Sun, Oct 30, 2011 at 6:42 PM, Father Chrysostomos <sprout@cpan.org> wrote:
> I’m working on the eval $unicode / evalbytes $bytes feature that was discussed earlier.
> 
> You can see it working on the sprout/eval branch.
> 
> 
> I'm computerless for another week or so, so I can't follow the repo. Sorry, Father C. IIRC there's some wrinkles regarding the interaction of 'use encoding' and the different eval types. Namely, what should that do? Zefram and Aristotle talked about this a while ago in #p5p, but unfortunately I don't have the IRC logs with me right now, so that's about all I can say for the moment.

encoding.pm is so broken already I’m not sure I need to worry. :-)

>  
> It is enabled by two feature features, unicode_eval and evalbytes.  I used two separate features, since I could not think of a name that would cover both.
> 
> 
> It could be one, I think? The character/Unicode eval being the default, and you turn on the bytes version lexically with the feature. There's no need for two features unless we suspect that that default will change in the future. But if we do go for the double feature,
> 
> no feature qw( unicode_eval evalbytes );
> eval "eeyup";
>  
> There needs to be some clarification in the docs of what that will do.

evalbytes is a separate keyword.  That would revert to the current schizophrenic implementation, like /d.

> (I mainly bring this up because the fc() keyword will probably need a double feature. But don't let that derail this thread)
> 
> Please raise any objections now before I finish and merge it.  (Objections saying you can just encode/decode first don’t count, because one would have to parse the code first for ‘use utf8’ directives.)
> 
> It still needs documentation.
> 
> 


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