Hot answers tagged terminology
14
The nearest Mathematica has to "types" are Heads of expressions that are Atoms. For example:
Through[{AtomQ, Head}[2]]
{True, Integer}
Through[{AtomQ, Head}[2 + I]]
{True, Complex}
Through[{AtomQ, Head}["cat"]]
{True, String}
and so on...
There are also somewhat different "types" in the context of Compile.
10
In Mathematica, the type of a built-in object is represented by the Head. For example, Head[3] is Integer, Head[1.5] is Real and Head[a] is Symbol (assuming that a hasn't been assigned a value, of course, because in that case, you'll get the Head of that value).
Note that for expressions of the form foo[bar,baz], the head is foo. Most expressions are ...
2
In Mathematica, values are expressions.
Types in computer science are collections of values.
Perhaps a type in Mathematica could be viewed as a pattern which matches a certain class of expressions.
Programming language designers often classify values according to the different roles that different types of values are allowed to play in that language. For ...
Only top voted, non community-wiki answers of a minimum length are eligible