Search                        Top                                  Index
HELP COLON                                  Revised by Fran Evelyn, July 85

The colon, :, has two uses in POP-11 syntax.

The first use is to flag the preceding word as a label (see HELP *LABELS),
which may then be the target of a *GOTO. For example:

    loop: n + 1 -> n;
    goto loop;

The second use is in matching; the colon can be used to restrict the match in
various ways, e.g.

    ??<variable>:integer    e.g. ??x:3
                    Restrict the variable to match the given number of items

    ?<variable>:<procedure name>    e.g. ?x:isword
    ?<variable>:<procedure>         e.g. ?x: % ismorethan(%0%) %
                    Before allowing the match, apply the procedure to the
                    matching item. If the result is FALSE, don't allow the
                    match to succeed. If the result is TRUE, allow it. If
                    the result is anything else, allow the match, but bind
                    the result to the variable.

    ??<variable>:<procedure name>   e.g. ??x:noun_prhase
    ??<variable>:<procedure>        e.g. ??x: % refersto(%item%) %

See HELP *MATCHES   - using the POP-11 matcher