Variable declaration reset: Difference between revisions

Content added Content deleted
(→‎{{header|J}}: more clarification for summary statement)
(actually -- major correction (J))
Line 231: Line 231:
But it would not alter the generated result.
But it would not alter the generated result.


J's control words (like '<tt>while.</tt>') do not create new variable scopes. However, given J's semantics, its behavior in the context of this task would be unchanged if the <tt>while.</tt> loop introduced a new variable scope. (However, if J's <tt>if.</tt> statement introduced a new variable scope, that would break this implementation of this task.)
J's control words (like '<tt>while.</tt>') do not create new variable scopes. If J introduced new variable scopes for control words, that would prevent updates inside those blocks from being visible outside those blocks.


=={{header|Java}}==
=={{header|Java}}==