up previous next
It

variable containing the last result

Syntax
It

Description
It is a top-level SYSTEM VARIABLE containing the last result computed but not assigned. It is the CoCoA equivalent to GAP's last .

When CoCoA evaluates a standalone expression, the result is assigned to the system variable named It (and then printed as if in a println command). You may use It in expressions just like any other variable.

Example
/**/  1+1; -- standalone expression ==> result is saved in "It".
2
/**/  It;
2

/**/  It+1;
3
/**/  It;
3

/**/  X := 17;  -- assignment is not a standalone expression, "It" is unchanged
/**/  It;
3
/**/  X+It;
20

See Also