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

Draft: generics section of structs chapter #104

Merged
merged 2 commits into from May 31, 2016
Merged

Conversation

steveklabnik
Copy link
Member

A light introduction to syntax.

A light introduction to syntax.
@steveklabnik
Copy link
Member Author

r? @aturon

x: f64,
y: f64,
}
```

Choose a reason for hiding this comment

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

I like starting out with concrete and then taking it generic.

For this example, I was wondering if it should start even simpler. Eg) just struct Point { ... } without any derives. Helps us to minimize concept count a bit and also helps avoid them later passing a type that doesn't satisfy one of these traits and getting a confusing error.

Copy link
Member Author

Choose a reason for hiding this comment

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

We dealt with the derives and such in the previous section.

Copy link

@sophiajt sophiajt May 24, 2016

Choose a reason for hiding this comment

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

@steveklabnik - I suspect people will likely not read from front to back, and that they'll often come here from googling "generics in Rust" or something similar. If possible, it may help to limit the concept count in any given section/chapter to what's necessary for that chapter to help readability for those types of readers (at the very least, limit concept count for your motivating example...)

Copy link
Member Author

Choose a reason for hiding this comment

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

The book is really meant to read front to back, unfortunately, or at least, it's not intended to be reference-style, but "read this in order to learn Rust."

@steveklabnik
Copy link
Member Author

Okay everyone, I have pushed a few things to address most of the comments here. I'm going to merge this one now, please open issues if there's anything else particularly important.

@steveklabnik steveklabnik merged commit dbb4cdc into master May 31, 2016
@steveklabnik steveklabnik deleted the structs-generics branch May 31, 2016 18:57
amitu pushed a commit to FifthTry/rust-book that referenced this pull request Jun 1, 2021
AbrarNitk pushed a commit to FifthTry/rust-book that referenced this pull request Jun 2, 2021
…lation-take2

rectangle の訳語:「四角形」→「長方形」(その2)
AbrarNitk pushed a commit to FifthTry/rust-book that referenced this pull request Jun 2, 2021
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