-- Poly.mesa
-- Last changed by Doug Wyatt, September 12, 1980 5:22 PM

DIRECTORY
Vector USING [Vec],
Area USING [Rec, Handle];

Poly: DEFINITIONS = {

Handle: TYPE = LONG POINTER TO Object;

New: PROC RETURNS[Handle];

Put: PROC[self: Handle, v: Vector.Vec] = INLINE {
self.procs.Put[self,v]
};
NewArea: PROC[self: Handle] RETURNS[Area.Handle] = INLINE {
RETURN[self.procs.NewArea[self]]
};
Free: PROC[selfPtr: LONG POINTER TO Handle] = INLINE {
self: Handle=selfPtr↑; selfPtr↑←NIL; self.procs.Free[self]
};

NewRec: PROC[Area.Rec] RETURNS[Area.Handle];

Object: PRIVATE TYPE = RECORD [
procs: LONG POINTER TO READONLY Procs,
data: LONG POINTER TO Data
];
Procs: PRIVATE TYPE = RECORD [
Put: PROC[self: Handle, v: Vector.Vec],
NewArea: PROC[self: Handle] RETURNS[Area.Handle],
Free: PROC[self: Handle]
];
Data: PRIVATE TYPE;

PolyImpl: PROGRAM;

}.