Next / Previous / Index / ITC Help System / Publications / Site map / NM Tech homepage

Setting the scanning subject in Icon

Tech Computer Center logo

When the ``e1 ? e2'' construct is used, not only is e1 established as the implicit scanning subject for the evaluation of expression e2, but there is also the idea of a current position within that subject.

Here is how an expression of the form ``e1 ? e2'' is evaluated:

  1. Expression e1 is evaluated. It should produce a string as its value.
  2. The value of e1 is stored in a predefined variable named ``&subject''.
  3. Another predefined variable named ``&pos'' is set to 1. This variable tracks the current scan position.
  4. Expression e2 is evaluated. Within any calls to string functions like ``match()'' inside expression e2, you can implicitly refer to the subject by omitting the second argument.

Next: Implicit matching in Icon
See also: Implicit scanning in Icon
Site map
Index: Keyword index to help pages
Help: New Mexico Tech Information Technology and Communications: Help System
ITC Publications
To report a problem: File a ticket
Send mail to the User consultant on duty or call them at 575-835-5437
Home: About New Mexico Tech

John Shipman,
Last updated: 1996/01/06 21:12:57 UT
QR two-dimensional bar code