Re: What should /\08/ match and do?

[email protected] (karl williamson)
Newsgroups perl.perl5.porters
Message-ID <[email protected]>
demerphq wrote:
> On 1 June 2010 19:05, Eric Brine <[email protected]> wrote:
>> On Tue, Jun 1, 2010 at 6:45 AM, demerphq <[email protected]> wrote:
>>> IMO these days octal, and any other non parenthesized code-like
>>> escapes should be deprecated.
>> A stylistic warning in ambiguous cases (like Abigail's "/\08/ interpreted as
>> /\x{00}8/" warning) sounds like a good idea, but not a *deprecation*
>> warning. That would mean we're planning on removing octal support from Perl,
>> and I haven't heard any reasons for doing that. Does supporting octal
>> escapes cause maintenance problems?
> 
> Any non-parenthesized escape structure using numeric values is a
> maintenance problem when seen from the point of view of modifying or
> joining snippets of a regex together.
> 
> cheers,
> Yves
> 
> 

I thought this was all settled until this heated up again, so I was 
about to submit patches to change \08, et. al., including the addition 
of \o{...}  for an arbitrary length octal character constant.  (I'll 
wait for things to settle down.)

What I find a maintenance problem is more that there are three copies of 
these, each with slightly different behavior, and have diverged over the 
years.  My understanding is that originally the regex and qq were 
handled in common code.  But, for the most part they've been split 
apart.  I can't remember why; Yves has said why in the past, and it's 
convincing.  And in regex code, there are two copies, one for bracketed 
character classes, and one for not, so there are differences in behavior 
there.  I actually haven't looked at the possibilities of unifying them; 
I've just presumed that function call overhead was a concern.  The 
snippets of code are small.  I suppose that the optimizer could inline 
them if they were static in the same file.  But I don't know enough 
about the possibilities of inlining across files.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.