Skip to content

Explain block like expression statements #30

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

Merged
merged 1 commit into from
May 16, 2017

Conversation

matthewjasper
Copy link
Contributor

A small thing that I noticed while going through the expressions chapter. unsafe blocks also have this property, but I'm not sure if they should just be considered another kind of block.
Does this need an example?

control flow expressions, such as [`loop`
expressions](expressions.html#infinite-loops) and [`if`
expressions](expressions.html#if-expressions), which evaluate to `()` can be
used as statements without a trailing semicolon.
Copy link
Member

@frewsxcv frewsxcv Apr 3, 2017

Choose a reason for hiding this comment

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

Should this be:

...can be used as expression statements...

Or are we using 'expression statement' and 'statement' interchangeably here?

Copy link
Member

@frewsxcv frewsxcv Apr 3, 2017

Choose a reason for hiding this comment

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

...which evaluate to () can be used as statements by omitting a trailing semicolon.

Maybe this makes it clear how to accomplish an expression statement?

@steveklabnik steveklabnik merged commit f7a108d into rust-lang:master May 16, 2017
@steveklabnik
Copy link
Member

Looks great, thank you!

@matthewjasper matthewjasper deleted the block-statement branch May 16, 2017 18:29
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.

3 participants