The problem:
I recently started reading the Golang Specification Manual and got stuck trying to understand the named and unnamed types in the relevant section. I come from a dynamic language and this has given me a bit of a headache.
The manual states:
A type determines the set of values and operations specific to values of that type. Types may be named or unnamed. Named types are specified by a (possibly qualified) type name; unnamed types are specified using a type literal, which composes a new type from existing types.
And continues:
Named instances of the boolean, numeric, and string types are predeclared. Composite types—array, struct, pointer, function, interface, slice, map, and channel types—may be constructed using type literals.
The problem here is that with the specification, the links make me jump around the pages and lose track of what is what with so many concepts thrown at me too fast.
Other Resources:
I have searched around for clarification on this and, other than the specification manual, resources are scarce. The only relevant material I could locate was:
Learning Go - Types - blog-post explaining nuances of the Type System in Go.
An issue here about pretty much the same thing I'm asking.
Unfortunately, I couldn't find any relevant questions on Stack Overflow regarding this. (and if they exist, I need to revise my search methods!). I'm asking because understanding the type system of a new language is one of the basic concepts in order to efficiently learn it.
So, the question:
Can somebody present a concise, clear example illustrating the differences between the concepts of named and unnamed types?*
*Additionally, explaining the concepts of qualified and pre-declared would be good for completeness but obviously not necessary.