Home : programming : racket

Awk

An implementation of awk in racket. Example:
#lang racket/base
(require mzlib/awk)

;; Reads the number of uncommented lines
(awk (read-line) (line) ((nlines 0))
  ("^\\s*;"  nlines)              ; A comment line.
  (else (+ nlines 1)))            ; Not a comment line.

Links to other sites

  • scsh awk - link to implementation and examples in Scheme Shell, which will apparently help you with racket.
    Author:  Mark Carter
    Created: 01-Oct-2011
    Updated: 01-Oct-2011