Darwin Help

Back to Index

type

Function type - type testing

Calling Sequence  type(exp)
type(exp,typeeval)
Parameters
NameTypeDescription

exp anythingan expression
typeeval any type 
Return Type  {boolean,type}
Synopsis The type function with two arguments returns true if the type of evaluated exp is typeeval. Otherwise, it returns false. With a single argument, it returns the type of expression exp.
Examples
> type(a, anything);
true
> type(5, integer);
true
> type('hello', string);
true
> type('abc');
string
See also types (This gives a full description of the valid types and their compositions)