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
Clarify documentation #17147
Comments
From @KES777Hi. Question about localization raises for this case: https://stackoverflow.com/q/57821354/4632019 In the attachment I suggest to clarify DOC a bit -- |
From @KES7770001-Clarify-documentation.patchFrom 8ad82c690492a96c443d9b4ad8bbb80755a00bdf Mon Sep 17 00:00:00 2001
From: Eugen Konkov <kes-kes@yandex.ru>
Date: Fri, 6 Sep 2019 15:06:38 +0300
Subject: [PATCH] Clarify documentation
Currently `foreach` and `for` loops are synonyms. Thus implicit localization
occurs not only for `foreach`. This change clarifies that implicit
localization occurs depending on style
---
pod/perlsyn.pod | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/pod/perlsyn.pod b/pod/perlsyn.pod
index 02cfb73b1a..6f57838c42 100644
--- a/pod/perlsyn.pod
+++ b/pod/perlsyn.pod
@@ -496,8 +496,7 @@ is therefore visible only within the loop. Otherwise, the variable is
implicitly local to the loop and regains its former value upon exiting
the loop. If the variable was previously declared with C<my>, it uses
that variable instead of the global one, but it's still localized to
-the loop. This implicit localization occurs I<only> in a C<foreach>
-loop.
+the loop. This implicit localization occurs I<only> for non C-style loop
X<my> X<local>
The C<foreach> keyword is actually a synonym for the C<for> keyword, so
--
2.23.0
|
From @jkeenanOn Fri, 06 Sep 2019 12:20:18 GMT, kes-kes@yandex.ru wrote:
Thank you for your suggestion. However, I don't think it improves the current documentation (which, except for a spelling correction, has existed in the current form since 2003). The text in question occurs in a paragraph clearly headed "Foreach Loops". There's nothing else in this paragraph about C-style 'for' loops, so I think adding something about 'non-C-style "for" loops' isn't helpful. My two cents. Thank you very much. |
The RT System itself - Status changed from 'new' to 'open' |
From @iabynOn Sat, Oct 05, 2019 at 03:12:28PM -0700, James E Keenan via RT wrote:
'for' is a synonym for 'foreach'. Whether its a C-style or not isn't -- |
Applied as 73bc018 |
Migrated from rt.perl.org#134411 (status was 'open')
Searchable as RT134411$
The text was updated successfully, but these errors were encountered: