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

Implicit scanning in Icon

Tech Computer Center logo

Much of the power of Icon in text analysis comes from the use of implicit scanning. In this technique, a particular string is designated as the current subject of scanning operations. Many of the usual string functions like ``match()'' can easily be used to analyze this subject.

In general, the expression

    e1 ? e2
means to make the string e1 the subject of scanning operations within expression e2. Within expression e2, you can call the common string functions like ``any()'' and ``find()'' and omit their second arguments. These functions will implicitly use the current subject as their second argument.

For example, this expression

    "syzygy" ? ( every write ( find ( "y" ) ) );
will produce the same result as
    every write ( find "y", "syzygy" );

See also: Text processing in Icon
Previous: Using strings 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/implscan.html