Re: Authors and Computer Scientists Scared of Definitions?
Posted: Sep 8, 2006 2:11 PM
> I think a type is the interpretation of data. By
> interpretation, I mean how the data in question is to be
> used along with what operations are valid on it.
> I find 'int' is not really a type. What is it? A number,
> ok? But what is it used for?
Above, you said: "I mean how the data in question is to be
used along with what operations are valid on it."
"int" is a representation of integral numbers. The operations on it loosely matches those you may do in mathematics on integral numbers.
I think describes it as a type, just fine: It's a type that may be used to model integral numbers.
> Is it a distance, pixels, socket number, etc?
Those are different concepts, and typically better modelled by separate types.
> If that were also defined, then it'd
> be more of a true type, IMNSHO. Classes don't qualify
> because the members don't tell anything to the compiler.
Huh? Classes tell the compiler what operations may be possible on them, and their results, if any. In other words, how values of a given class may be used.
> You can overload operators, but it's an ad-hoc solution.
Why is that an ad-hoc solution, and solution to what?