OtherNode.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
written by Paxton. May 1981
last written by McGregor. June 10, 1982 4:38 pm
Doug Wyatt, March 2, 1985 4:08:18 pm PST
DIRECTORY
Rope USING [ROPE],
TextNode USING [RefOtherNode];
OtherNode: CEDAR DEFINITIONS
= BEGIN
RefOtherNode: TYPE = TextNode.RefOtherNode;
Register: PROC [variety: ATOM,
reader: ReadSpecsProc, writer: WriteSpecsProc, copier: CopyInfoProc];
registers these procs for this variety of node
they will be called by DoSpecs, GetSpecs, and CopyInfo
ReadSpecsProc: TYPE = PROC [n: RefOtherNode, specs: Rope.ROPE];
WriteSpecsProc: TYPE = PROC [n: RefOtherNode] RETURNS [specs: Rope.ROPE];
CopyInfoProc: TYPE = PROC [old: RefOtherNode] RETURNS [newinfo: REF ANY];
DoSpecs: ReadSpecsProc;
used when reading files
calls the registered reader for this variety of node
sets n.info ← specs if no reader is registered
GetSpecs: WriteSpecsProc;
used when writing files
calls the registered writer for this variety of node
if no writer is registered, returns n.info if it is a rope, NIL otherwise
CopyInfo: CopyInfoProc;
used when copying nodes
calls the registered copier for this variety of node
if no copier is registered, returns old.info
END.