CoCoA:Type
From ApCoCoAWiki
Type
the data type of an expression
Description
This function returns the data type of E. The function <ttref>Types</ttref>
returns the list of CoCoA data types.
Example
Define CollectInts(L) Result := []; Foreach X In L Do If Type(X) = INT Then Append(Result,X) EndIf EndForeach; Return Result EndDefine; CollectInts([1,<quotes>a</quotes>,2,<quotes>b</quotes>,3,<quotes>c</quotes>]); [1, 2, 3] ------------------------------- Type(Type(INT)); -- Type returns a value of type TYPE TYPE ------------------------------- Types(); [NULL, BOOL, STRING, TYPE, ERROR, RECORD, DEVICE, INT, RAT, ZMOD, POLY, RATFUN, VECTOR, IDEAL, MODULE, MAT, LIST, RING, TAGGED(<quotes/>), FUNCTION] -------------------------------
Syntax
Type(E:OBJECT):TYPE
<type>type</type>