CoCoA:Sprint
From ApCoCoAWiki
Sprint
convert to a string
Description
This function takes any CoCoA expression and converts its value to a
string. One use is to check for extremely long output before printing
in a CoCoA window.
Example
Use R ::= Q[x,y]; I := Ideal(x,y); J := Sprint(I); I; Ideal(x, y) ------------------------------- J; -- The output for I and J looks the same, but ... Ideal(x, y) ------------------------------- Type(I); -- I is an ideal, and IDEAL ------------------------------- Type(J); -- J is just the string <quotes>Ideal(x, y)</quotes>. STRING ------------------------------- J[1]; -- the 1st character of J I ------------------------------- J[2]; -- the 2nd character of J d ------------------------------- Len(J); -- J has 11 characters 11 -------------------------------
Syntax
Sprint(E:OBJECT):STRING
<type>io</type> <type>printing</type> <type>string</type>