News flash: I'm going to Australia in February, so this Web site may be switched off at any time.
In an Icon program, types are defined only by their run-time usage. So far in this tutorial we have encountered these types:
integer
: As in the constants 0 and 1.
real
: For constants written with a decimal point
(e.g., ``3.0
''), and the result returned by the
square root function ``sqrt()
''.
string
: For constants written inside double quotes,
like the first argument to ``write()
'' in this statement:write ( "The sum of 1 to 5 is ", sum );
procedure
: The ``main()
'' and other
procedures in our sample programs have this type.
Icon has a number of other useful built-in types. You can also create your own types.
john@nmt.edu