Skip to content

Question: Can we restrict the scope of internally declared our parameters? #1813

Answered by HaloFour
KorporalKernel asked this question in Q&A
Discussion options

You must be logged in to vote

Why was this not done? If I want it to not be out of scope then I'd simply declare it before the "if" block.

It was decided that by not having leaky scope severely limited the use cases in which the feature could be used. Big debate ensued. The language designers made their decision and that's what was implemented.

Replies: 6 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by YairHalberstadt
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #1813 on October 18, 2020 11:50.