Next
/
Previous
/ Index
/ TCC Help System
/ Publications
/ Site map
/ NM Tech homepage
Setting the scanning subject in Icon
|
|
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:
- Expression e1 is evaluated. It should produce a string
as its value.
- The value of e1 is stored in a predefined variable
named ``
&subject''.
- Another predefined variable named ``
&pos'' is
set to 1. This variable tracks the current
scan position.
- 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 Computer Center: Help System
TCC Publications
Home:
About New Mexico Tech
John Shipman, john@nmt.edu
Last updated: 1996/01/06 21:12:57 UT
URL: http://www.nmt.edu/tcc/help/lang/icon/subject.html