News flash: I'm going to Australia in February, so this Web site may be switched off at any time.
The Icon function ``table()
'' creates a new table.
table()
'' with no arguments creates an empty
table.
table(x)
'' creates a table in which
all entries are assumed to have value x until otherwise
defined.
With the first form shown above, a reference to an element that has never been defined causes an error. If a table created with the second form, and then you refer to an element that has never been defined, you will get value x.
For example, this code
phoneTable := table();creates an empty table, while this code
totalsTable := table ( 0 );makes ``
totalsTable
'' a table in which every element is
assumed to be 0 until it is changed to some other value.
john@nmt.edu