Skip to content

Conversation

@PureFox48
Copy link
Contributor

Fixes #1176.

Copy link

@RobLoach RobLoach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call to mention that variable scope it kept for the function.

It may make more sense to document this in the Functions section, as this seems more like a property of closures, rather than loops and control flow.

@PureFox48
Copy link
Contributor Author

Well, the Closures section already makes clear what it means to capture a variable.

This PR is peculiar to the for statement where it looks like there’s only one variable for the entire loop when in fact there’s a separate instance for each iteration. Although this only really manifests itself when there’s a closure involved, I still think that the Control Flow section is the best place to put it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should we document this aspect of for loop control variable behavior?

2 participants