Awk: awk.ss

Next: Classes with defined Methods: Up: MzLib Libraries Previous: MzLib Libraries

## Awk: `awk.ss`

Files: `awk.ss`

This library defines the `awk` macro from Scsh:

``

      (awk next-record-expr
           (record field-variable   )
           counter-variable/optional
           ((state-variable init-expr)   )
           continue-variable/optional
        clause   )

      counter-variable/optional is either empty or:
         variable

      continue-variable/optional is either empty or:
         variable

      clause is one of:
         (test body-expr   )
         (test => procedure-expr)
         (/ regexp-str / (variable-or-false   ) body-expr   )
         (range exclusive-start-test exclusive-stop-test body-expr   )
         (:range inclusive-start-test exclusive-stop-test body-expr   )
         (range: exclusive-start-test inclusive-stop-test body-expr   )
         (:range: inclusive-start-test inclusive-inclusive-stop-test body-expr   )
         (else body-expr   )
         (after body-expr   )

      test is one of:
         integer
         regexp-str
         expr

      variable-or-false is one of:
         variable
         #f

For detailed information about `awk`, see Olin Shivers's Scsh Reference Manual. In addition to `awk`, the Scsh-compatible procedures `match:start`, `match:end`, `match:substring`, and `regexp-exec` are defined. These `match:` procedures must be used to extract match information in a regular expression clause when using the `=>` form.