patch.icn: Procedures for UNIX-like patch(1)

link patch
June 18, 1990; Rich Morin
Requires: co-expressions
This file is in the public domain.

This procedure produces a sequence of edited items, reading a source
stream (from) and a stream of difference records (diffs), as generated
by dif.icn.

An optional parameter (rev) causes the edits to be made in reverse.
This allows an old stream to be regenerated from a new stream and an
appropriate stream of difference records.

The original patch(1) utility was written by Larry Wall, and is used
widely in the UNIX community.  See also diffu.icn and patchu.icn, the
utility program versions of dif.icn and patch.icn.

Usage:       patch(old, diff)        # patch old to new via diff
             patch(new, diff, rev)   # patch new to old via diff

Source code | Program Library Page | Icon Home Page