-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Support Ruby-style block arguments #1054
Comments
ghost
assigned marijnh
Oct 21, 2011
marijnh
added a commit
that referenced
this issue
Oct 21, 2011
marijnh
added a commit
that referenced
this issue
Oct 21, 2011
This makes it possible to omit the semicolon after the block, and will cause the pretty-printer to properly print such calls (if pretty-printing of blocks wasn't so broken). Block calls (with the block outside of the parentheses) can now only occur at statement level, and their value can not be used. When calling a block-style function that returns a useful value, the block must be put insde the parentheses. Issue #1054
bors
pushed a commit
to rust-lang-ci/rust
that referenced
this issue
Oct 26, 2020
…#1054) * Longer README about how to use this instead of `cargo run` Resolves rust-lang#1052. Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
coastalwhite
pushed a commit
to coastalwhite/rust
that referenced
this issue
Aug 5, 2023
celinval
pushed a commit
to celinval/rust-dev
that referenced
this issue
Jun 4, 2024
* Assume an x86_64 architecture for the machine model * Add checks for arch spec/options * Check platform instead of architecture * Add debug statement * print platform * Use `starts_with` for apple platforms * minor comment change * Make code simpler
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A block (
{
followed by|
or||
) appearing after an expression is (with the same precedence asx.y
,x[y]
,x()
, etc) treated as a block value passed to a function. If the expression was a call, the block argument is added as a last argument. If it was a non-call, it becomes a call with a single argument.The text was updated successfully, but these errors were encountered: