develooper Front page | perl.perl5.porters | Postings from February 2015

[perl #123814] grok_atou() for regexp quantifiers

Thread Previous | Thread Next
Hugo van der Sanden via RT
February 19, 2015 12:39
[perl #123814] grok_atou() for regexp quantifiers
Message ID:
On Wed Feb 18 18:45:47 2015, jhi wrote:
> NOW would be the time to fix the API of grok_atou.
> Why NOW?  Because it has been only in 5.21.x

Oh, I hadn't noticed that it was so recent; in that case, strongly agreed.

> Off-hand, maybe it should have a special-special case of
> /^0+/ becoming zero.  Maybe.  As Hugo pointed out, the ugly
> octal case rears its 010 head.  Or maybe make it return
> boolean - in which case it cannot be an atoi drop-in-replacement any
> more.

Given we've already killed atoi uses, I don't think it's a big problem that it would no longer be a drop-in replacement.

I'll have a go at making a version that retains the strictness but returns boolean success, with target-type-specific variants. In the meantime I've pushed the branch hv/grok with what I think is the appropriate short-term fix for the primary issue in this ticket - I'd also like comments on whether we're happy to add a new failure message to cover /x{00}/ and /x{999999999999999999999999}/.


via perlbug:  queue: perl5 status: open

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