-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Have some form of destructing if #1529
Comments
Could you achieve this with a HOF? if_some(optional_value) {|value|
do something;
} |
For the special case of the |
Rust does have an |
(To be fair, marijn just added |
Macros? Also, https://mail.mozilla.org/pipermail/rust-dev/2012-April/001636.html may be relevant. The "brace-free" syntax that @pcwalton suggested in that thread may help with this problem. |
On Thu, 12 Apr 2012, Tim Chevalier wrote:
I am proposing new syntax. As Rust syntax is not at the moment extensible, I do not see how a macro will really help.
I do not see how that can help. |
I mean that having to write the |
Yes it might. But the problem is with the empty default case. I always fell obligated to have some sort of comment in the default case to make it clear that it was meant to be empty. With a destructing if, the intention is clear. |
Ok. I see how this could be useful, but right now we're generally trying not to add more features. Leaving it open in case anyone else has insight. |
The right solution here is to implement macros, and then implement your feature on top of that. I'd rather not add features that we then remove later in favor of macros because Rust macros are hard to use right now. |
This commit adds initial documentation for LLVM Kernel Control Flow Integrity (KCFI) support to the Rust compiler (see rust-lang#105109 and rust-lang#89653).
This commit adds initial documentation for LLVM Kernel Control Flow Integrity (KCFI) support to the Rust compiler (see rust-lang#105109 and rust-lang#89653).
Having to constantly write code like this:
Is unnecessary verbose in my opinion, and gets annoying to have to constantly write. I would like to be able to say something like:
Although it doesn't have to be that exact syntax.
The text was updated successfully, but these errors were encountered: