Using the basic Icon types
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 ``
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 Shipman, email@example.com
Last updated: 1996/01/06 21:12:57 UT