Icon programs consist of one or more procedure definitions, and execution begins by calling the procedure named main . Expressions can produce zero or more values. The evaluation mechanism tries all combinations of values from generators in pursuit of a successful outcome. If y is less than x , evaluation succeeds and produces the value x . Otherwise, evaluation fails, and no value is produced.
Comparison operators produce the value of their right operand if they succeed.
Failure drives control expressions and inhibits subsequent evaluation. The backtracking implied by the goal-directed evaluation mechanism is limited to the expression in which it occurs. Icon has numerous built-in procedures and operators that help analyze strings. Many of these take strings and positions as operands and return strings or positions. Positions denote locations between characters.