Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document :my and :our within regex blocks #1475

Closed
lefth opened this issue Aug 29, 2017 · 0 comments
Closed

Document :my and :our within regex blocks #1475

lefth opened this issue Aug 29, 2017 · 0 comments
Labels
docs Documentation issue (primary issue type) good first issue If you want to dive in, this would be a good place to start update part of "docs" - indicates this is an update for an existing section; rewrite, clarification, etc.

Comments

@lefth
Copy link
Contributor

lefth commented Aug 29, 2017

:my and :our usage within regexes is not documented. For :my, something like this would be nice:

:my $foo = 0 is needed to declare a variable that has scope throughout and beyond the regex body, unlike variables declared in blocks. For example, the following trivial example shows a counter used for debugging:

$paragraph ~~ rx| :my $counter = 0; ( \V* { ++$counter } ) *%% \n |; say "Matched $counter lines";

If that's too verbose, a sentence or two could be added to the example that uses :my (but doesn't explain it).

@zoffixznet zoffixznet added the docs Documentation issue (primary issue type) label Aug 30, 2017
@AlexDaniel AlexDaniel changed the title Suggestion: document :my and :our within regex blocks Document :my and :our within regex blocks Jan 6, 2018
@JJ JJ added JJ TPF Grant good first issue If you want to dive in, this would be a good place to start labels Apr 21, 2018
@JJ JJ removed the JJ TPF Grant label May 14, 2018
@JJ JJ added the update part of "docs" - indicates this is an update for an existing section; rewrite, clarification, etc. label May 21, 2018
JJ added a commit that referenced this issue May 21, 2018
@JJ JJ closed this as completed in 491f703 May 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation issue (primary issue type) good first issue If you want to dive in, this would be a good place to start update part of "docs" - indicates this is an update for an existing section; rewrite, clarification, etc.
Projects
None yet
Development

No branches or pull requests

3 participants