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

change struct separator syntax from ";" to "," #3263

Closed
bblum opened this issue Aug 23, 2012 · 5 comments
Closed

change struct separator syntax from ";" to "," #3263

bblum opened this issue Aug 23, 2012 · 5 comments
Labels
A-grammar Area: The grammar of Rust

Comments

@bblum
Copy link
Contributor

bblum commented Aug 23, 2012

Now that we don't write let for struct fields anymore, struct x { y: t1; z: t2; } looks hideous. I'd much rather it feel more like records: struct x { y: t1, z: t2 }.

@brson
Copy link
Contributor

brson commented Aug 24, 2012

Something definitely needs to change here and this suggestion sounds reasonable to me.

@nikomatsakis
Copy link
Contributor

I seem to constantly be writing , instead of ;. Even though ; is more consistent with C, I am +1 on this. , feels lighter and it mirrors the literal syntax, which I think is a general goal of Rust as I understand it.

@bblum
Copy link
Contributor Author

bblum commented Aug 24, 2012

my impression is that record literals were also planned to go away.

@bblum
Copy link
Contributor Author

bblum commented Sep 4, 2012

is it possible to optionally omit the last , before the }, like in the old records?

@pcwalton
Copy link
Contributor

pcwalton commented Sep 5, 2012

Yes.
On Sep 4, 2012 2:17 PM, "Ben Blum" notifications@github.com wrote:

is it possible to optionally omit the last , before the }, like in the
old records?


Reply to this email directly or view it on GitHubhttps://github.com//issues/3263#issuecomment-8279263.

bors pushed a commit to rust-lang-ci/rust that referenced this issue May 15, 2021
RalfJung pushed a commit to RalfJung/rust that referenced this issue Jan 22, 2024
RalfJung pushed a commit to RalfJung/rust that referenced this issue Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-grammar Area: The grammar of Rust
Projects
None yet
Development

No branches or pull requests

4 participants