Variable declaration reset: Difference between revisions

m
m (→‎{{header|J}}: try to spell things out in a bit more detail, and have a little fun with the naming issues)
Line 285:
But it would not alter the generated result.
 
Also... J's control words (like '<tt>while.</tt>') do not create new variable scopes. Given J's scoping rules, if J introduced new variable scopes for control words, that would prevent updates inside those blocks from being visible outside those blocks (unless we also added new scoping rules for that case -- a major engine upgrade -- or used non-local variables, such as J's "locales" which are probably out of scope for this task...). Where J's block scope isolation is desirable, we can use nested functions (J's verbs, adverbs or conjunctions).
 
But J's design -- which does not allow variables to be declared which are not assigned -- makes most variable declaration problems trivial. This is arguably a good thing.
 
=={{header|Java}}==
6,962

edits