up previous next
extended list of types involved in an expression
shape(E: LIST): LIST (of TYPE)
shape(E: RECORD): RECORD (of TYPE)
where OTHER stands for a type which is not LIST, MAT, or RECORD.
This function returns the extended list of types involved in the
expression E as outlined below:
type(E) = LIST
In this case, Shape(E) is the list whose i-th component is the type
of the i-th component of E.
type(E) = MAT
In this case, Shape(E) is a matrix with (i,j)-th entry equal to the
type of the (i,j)-th entry of E.
type(E) = RECORD
In this case, Shape(E) is a record whose fields are the types of the
fields of E.
is the type of E.
/**/ use R ::= QQ[x];
/**/ L := [1,[1,"a"], x^2-x];
[INT, [INT, STRING], POLY]
/**/ R := record[name := "test", contents := L];
record[contents := [INT, [INT, STRING], POLY], name := STRING]
There are undocumented functions,
for determining if the
of a CoCoA expression is a
of another. To see the code for these functions, enter