News flash: I'm going to Australia in February, so this Web site may be switched off at any time.
The notation ``r.f
''
refers to field f
of record r. For example, assuming you have declared the
``complex
'' type (as in
declaring an Icon record type),
you can write the imaginary part of a complex number x using:
write ( x.i );
Since a record in Icon is functionally identical to a list
of the fields, you can also access the nth field of
a record f as ``f[n]
''.
For example, this expression writes all the fields of a record r:
every write ( ! r );See generating the elements of an Icon list for more information about the ``
!
'' operator.
This ends our Icon tutorial. There are a lot more useful features, though. For more information, see the references for the Icon language.
john@nmt.edu