Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Capturing parenthesis and grouping square brackets

by grondilu (Friar)
on Jun 18, 2013 at 03:17 UTC ( #1039504=note: print w/replies, xml ) Need Help??

in reply to Capturing parenthesis and grouping square brackets

I'm not sure I understand the implications your point could have on Perl 6. Do you suggest that it might make sense to do the non-capturing groupings with parenthesis, and the capturing ones with brackets, instead of the other way around?

Honestly I think it would make some sense, but it would nevertheless be confusing, for we all remember that () does capture, just because we know that's what they also do in Perl 5.

  • Comment on Re: Capturing parenthesis and grouping square brackets

Replies are listed 'Best First'.
Re^2: Capturing parenthesis and grouping square brackets
by Eily (Prior) on Jun 18, 2013 at 11:09 UTC

    That's pretty much what I meant yes. There are major changes in Perl 6's rules anyway (like square brackets actually, which go from character class to grouping), so expecting metacharacters to have the same meaning might lead to some trouble. But as stated in ambrus's answer, that's not only what Perl user would expect, it's what a lot of people using other languages would expect. Still, Perl 6's rules would be quite the surprise, because one would expect Perl of all languages to be compatible with PCRE. But actually, one of the main focuses of apocalypse 5 is to mend whatever went wrong with Perl regexes, and PCRE.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1039504]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2018-05-25 02:03 GMT
Find Nodes?
    Voting Booth?