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

condition! macro should support multiple declarations #4344

Closed
ghost opened this issue Jan 4, 2013 · 2 comments
Closed

condition! macro should support multiple declarations #4344

ghost opened this issue Jan 4, 2013 · 2 comments
Labels
A-syntaxext Area: Syntax extensions C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@ghost
Copy link

ghost commented Jan 4, 2013

It would be nice to be able to write

condition! {
    foo: int -> ~str;
    bar: char -> bool;
}

instead of

condition! { foo: int -> ~str; }
condition! { bar: char -> bool; }

for modules that define a number of conditions.

This should only require a small change to libsyntax/ext/expand.rs once macros are capable of expanding to multiple items, per #4021 and #3086.

@graydon
Copy link
Contributor

graydon commented Jan 24, 2013

I was initially going to do that, but then decided that the way it's organized now will permit attaching a doc-comment to each condition, where a multiple-condition-declaration would not (and we don't have any mechanism for transcribing comments from the arguments-to-macros). So I went with the current limited format.

Is this an acceptable explanation?

@ghost
Copy link
Author

ghost commented Jan 24, 2013

Makes sense to me.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-syntaxext Area: Syntax extensions C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

1 participant