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


Finding the size of an Icon list

The unary ``*'' operator, applied to a list, returns the number of elements in the list. For example, this program fragment should print the number 23:

    foo  :=  list ( 23 );
    write ( * foo );
Here is an expression that writes every element of list ``L'':
    every  i := 1 to ( * L )  do
      write ( L[i] );

Next: Using Icon lists as arrays
See also: Using the Icon programming language
Previous: Creating an Icon list of a fixed size

John W. Shipman, john@nmt.edu