Jump to content

Talk:Local variable

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
Latest comment: 1 month ago by Gurung Roshan in topic Reason for the "needs update" tag?

"Some advocate that all variables should be of local scope to avoid issues with side-effects. In other cases, programming paradigms and languages themselves, such as the functional programming paradigm and the Haskell language require all "variables" (or the closest equivalent under that paradigm to variables) to be of local scope, and the functionality of the program is achieved only by passing local variables from one function to another."

-doesn't make sense: "should be of local scope... In other cases, ...require all 'variables' (or the closest equivalent under that paradigm to variables) to be of local scope"

-in Java you can have local static variables

—Preceding unsigned comment added by 70.49.14.250 (talk) 12:31, 18 August 2006 (UTC)Reply

Reason for the "needs update" tag?

[edit]

The {{Update}} tag was added on 13 November 2025 with no edit summary and no explanation left here, so I'm not sure what specifically prompted it.

I went through the article's content, the scoping mechanics, the Perl my/local section, and the Ruby section and didn't find anything that's become factually inaccurate or outdated. The citations also still resolve correctly.

One thing I did notice that the article doesn't cover: Java 25 shipped a feature called Scoped Values in September 2025 (around the same time this tag was added), which works somewhat like dynamic scoping for local variables. I haven't looked closely enough at the JEP to know if it fits cleanly into this article's scope, but it's the only plausible gap I found.

Does anyone know what prompted the original tag, or have a view on whether Scoped Values is worth adding here? Otherwise I'd lean toward removing the tag as unexplained. Gurung Roshan (talk) 11:25, 25 September 2026 (UTC)Reply