* Nilone:
Much of the point is that there's no single definition of "type" that's suitable
for all types and programming languages.
To take but one simple example, you started out with a requirement that a type
has a name. And in the example I gave of a practically useful incomplete C++
type the name was crucial: the name, and its scope attribute, was the /only/
property of that type! But when in C++ you write (void*)p, perhaps in order to
output a textual representation of p, then you're using an anonymous type, one
with no name -- so these two types have apparently /nothing/ in common...
Of course what they do have in common is what you can do with them in an outer
environment, such as (in C++) using them as template parameters.
And that leads to an operative definition of "type": something is a "type" if it
can be used as a type -- inherent properties such as a possible value set
don't really count, they merely serve to help one particular usage or another.
That's what makes purported general definitions of "type" so hopelessly
misguided. A lot of rigor applied to defining a chair as having a seat and four
legs and back and so on. Thus excluding quite a lot of real-world chairs
(they're chairs because they can be used or are used as chairs)...
And different programming languages have different notions of type, and some,
like C++, have a multitude of notions of type.
And so much of the point is also what James Kanze wrote: that "value type" is a
design level notion, which can't really be rigorously defined (because the act
of doing so loses the concept's usefulness, like a rigorous definition of chair)
but is mostly understood in terms of whether object identity matters or not.
When you see it you can recognize it, and when you say it, most people
understand what you mean, in the sense that it refers to the things they will
recognize as value types. But I strongly doubt that a general definition of the
formal kind is possible, and even if it were, would be of practical value..
Formal definitions are nice & useful for reasoning about things as long as one
is very aware that one is considering a very limited, simplified model.
But it's just ungood to try to impose them on the world, or use them as
classifiers, lest you end up with a baggy chair classified as non-chair....
Cheers & hth.,
- Alf