Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document macros goto and label #23656

Merged
merged 2 commits into from
Sep 12, 2017
Merged

Document macros goto and label #23656

merged 2 commits into from
Sep 12, 2017

Conversation

mschauer
Copy link
Contributor

This connects with issues #7706 and #13617 and the stall pull request #15490. This pull request here only adds docstrings which then end up in the syntax section of stdlib/base.md, but does not change the manual.

@ararslan ararslan added domain:docs This change adds or pertains to documentation macros @macros labels Sep 10, 2017

`@goto name` unconditionally jumps to the statement at the location [`@label name`](@ref).

`@label` and `@goto` cannot create jumps to top-level statements. Attempts cause an
Copy link
Contributor Author

Choose a reason for hiding this comment

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

" jumps to different top-level statements " if I think about it

`@goto name` unconditionally jumps to the statement at the location [`@label name`](@ref).

`@label` and `@goto` cannot create jumps to top-level statements. Attempts cause an
error. To use `@goto` at the top-level, enclose the `@label` and `@goto` in a block.
Copy link
Sponsor Member

@StefanKarpinski StefanKarpinski Sep 11, 2017

Choose a reason for hiding this comment

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

This is kind of a contradiction – "to use @goto at the top level, do not use @goto at the top level." Or maybe it's a koan.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"To still use @goto in this situation..." works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:docs This change adds or pertains to documentation macros @macros
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants