News flash: I'm going to Australia in February, so this Web site may be switched off at any time.


Creating an Icon table

The Icon function ``table()'' creates a new table.

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.
Next: Storing items in an Icon table
See also: Using the Icon programming language
Previous: Using the table type in Icon

John W. Shipman, john@nmt.edu