-
Notifications
You must be signed in to change notification settings - Fork 13.3k
RFC: remove do
#10815
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
Comments
No, don't remove do before you have better syntax. Fn({}) is too ugly to accept. |
I've often felt like |
I think we should remove it at this point. I liked it better when it worked for stack closures. |
@brson Is it worth making |
@hatahet Do you mean making it a built-in keyword with syntax of its own? As it stands, it is in the prelude which means it's a built-in function. When spawn(proc() {
...
}) That is not a horribly ugly monstrosity. Sure, it's not quite as nice-looking as |
@chris-morgan Yep, that's what I was referring to. You're right -- I guess |
I haven't removed the keyword yet; this is just a matter of stopping using it. Changing the `do` keyword to complaining of obsolete syntax is the next step. Also I have *not* removed the `do` keyword tests; they still use `do`. These are: - src/test/compile-fail/do-lambda-requires-braces.rs - src/test/compile-fail/do1.rs - src/test/compile-fail/do2.rs - src/test/compile-fail/issue-3044.rs - src/test/run-pass/block-arg-can-be-followed-by-binop.rs - src/test/run-pass/block-arg-can-be-followed-by-block-arg.rs - src/test/run-pass/block-arg-can-be-followed-by-call.rs - src/test/run-pass/block-arg-in-parentheses.rs - src/test/run-pass/block-arg-used-as-any.rs - src/test/run-pass/block-arg.rs - src/test/run-pass/do-empty-args.rs - src/test/run-pass/do-no-args.rs - src/test/run-pass/do1.rs - src/test/run-pass/do2.rs - src/test/run-pass/do3.rs
I've been de- |
Nominating. |
In light of the recent email, I've taken this up as a relatively-easy but apparently-helpful task. |
@hatahet I think we're more likely to prettify
Is pretty hot, though I think the braces don't work in that position right now. |
@bytbox Awesome! Ping me or anybody on #rust-internals if you need some guidance. |
@brson Great to hear :) |
I started a mailing list thread on this topic about a week ago; in the first post I summarised the situation. I'll quote it here verbatim:
After some discussion, I think that for the moment, removing
do
is probably the better option. We can then see about adding it or something similar back later if we want to.So then, concrete proposal: remove
do
from the language.The text was updated successfully, but these errors were encountered: