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

Add a do-while loop macro #8

Merged
merged 3 commits into from Mar 5, 2015
Merged

Add a do-while loop macro #8

merged 3 commits into from Mar 5, 2015

Conversation

kmcallister
Copy link
Collaborator

No description provided.

@utkarshkukreti
Copy link
Contributor

Is this really useful? Using the macro requires more code than the expanded form, and the expanded form doesn't seem to be too bad (IMO).

@kmcallister
Copy link
Collaborator Author

The expanded form is short but cryptic. You might prefer the macro if you prioritize readability, or you're writing code for an audience that isn't steeped in Rust idioms.

I don't think it's tremendously useful, but I don't think there's anything wrong with including it, either.

@@ -27,7 +27,8 @@ macro_rules! matches {
}

/// Work around "error: unexpected token: `an interpolated tt`", whatever that
/// means.
/// means. (Probably rust-lang/rust#22819.)
#[doc(hidden)]
Copy link
Owner

Choose a reason for hiding this comment

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

I wish we could do without stuff like this, since it means you basically have to glob macro_use from this crate to get any use, whereas macro_use(specific, macros) would probably be better.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There's an unimplemented part of macro reform which allows an exported macro to list some private "helper macros".

I believe _tt_as_expr_hack itself won't be necessary once rust-lang/rust#22819 is fixed.

@reem
Copy link
Owner

reem commented Mar 5, 2015

I also think this is a reasonable thing to include. I'm curious to hear thoughts on my comment on the _tt_as_expr hack, but that doesn't need to stop this from merging.

reem added a commit that referenced this pull request Mar 5, 2015
@reem reem merged commit 86208a8 into reem:master Mar 5, 2015
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.

None yet

3 participants