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

tour: better explanation about type declarations? #13530

Open
mdempsky opened this issue Dec 8, 2015 · 5 comments
Open

tour: better explanation about type declarations? #13530

mdempsky opened this issue Dec 8, 2015 · 5 comments

Comments

@mdempsky
Copy link
Member

mdempsky commented Dec 8, 2015

Context: https://tour.golang.org/moretypes/2

I just decided to look through the Go tour to see how it explains named types and assignability. As far as I can tell, the only explanation is the parenthetical sentence "And a type declaration does what you'd expect."

Based on user questions like issue #13529, I suspect that type declarations do not necessarily do what users expect, and perhaps it's worth elaborating on this point somehow.

@mdempsky mdempsky added this to the Unreleased milestone Dec 8, 2015
@MatejLach
Copy link

What about "A type declaration creates a new, named, type which can be mixed in expressions with either a value of the same named type, or an unnamed type with the same underlying representation. "
What do you think @mdempsky ?

EDIT: Better wording.

@mbbroberg
Copy link
Contributor

Joining this conversation from #14152. I rewrote it as:

"A type determines the set of values and operations specific to values of that type. Each declared type has an underlying type that goes back to the basic types discussed earlier.

Let's define a type that is also a struct, which is made up of multiple fields."

No matter the wording, I'm a fan of 2-3 sentences here. Types turning into types sounds like a Dr Seuss riddle at first. Smaller, simpler sentences help break that down.

@zombiezen
Copy link
Contributor

@broady This is a dupe of golang/tour#121

@MatejLach
Copy link

MatejLach commented Mar 13, 2017

@zombiezen Is it?, golang/tour#121, was reported almost a year after this issue, but I agree that the repo where it is reported is probably better suited for this, if that's what you mean.

@gopherbot
Copy link

CL https://golang.org/cl/36314 mentions this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants