IPVector.mesa
Last edited by:
Doug Wyatt, April 29, 1983 2:11 pm
DIRECTORY
IPBasic USING [Any, Integer, State, Vec, Vector, VectorShape];
IPVector: CEDAR DEFINITIONS
= BEGIN OPEN IPBasic;
Get: PROC[v: Vector, n: Integer] RETURNS[Any];
Get the element of v named by n.
! MasterError[BoundsFault] if n is out of range
MakeVecLU: PROC[self: State, l, u: Integer] RETURNS[Vector];
Make a vector with the lower bound l and upper bound u.
Obtain the elements by popping n=u-l+1 values off the stack.
! MasterError[InvalidArgs] if n<0 or n>maxInteger
! MasterError[LimitExceeded] if n>maxVecSize
! MasterError[StackUnderflow] if fewer than n values are on the stack
MakeVec: PROC[self: State, n: Integer] RETURNS[Vector];
Make a vector with lower bound 0 and upper bound n-1.
Obtain the elements by popping n values off the stack.
! MasterError[LimitExceeded] if n>maxVecSize
! MasterError[StackUnderflow] if fewer than n values are on the stack
Shape: PROC[v: Vector] RETURNS[VectorShape];
Return the shape of v.
GetProp: PROC[v: Vector, propName: Any] RETURNS[x: Any, b: BOOL];
GetP: PROC[v: Vector, propName: Any] RETURNS[Any];
MergeProp: PROC[v1, v2: Vector] RETURNS[Vector];
Make: PROC[self: State, shape: VectorShape] RETURNS[Vec];
Make a Vec with lower bound shape.l and upper bound u=shape.l+shape.n-1.
Obtain the elements by popping shape.n values off the stack.
! MasterError[InvalidArgs] if u>maxInteger
! MasterError[LimitExceeded] if shape.n>maxVecSize
! MasterError[StackUnderflow] if fewer than n values are on the stack
VectorToVec: PROC[v: Vector] RETURNS[Vec];
Convert a Vector to a Vec.
! MasterError[LimitExceeded] if v's size exceeds maxVecSize
NewVec: PROC[shape: VectorShape] RETURNS[Vec];
Make a new Vec, filled with nullAnys.
CopyVec: PROC[v: Vec] RETURNS[Vec];
Make a copy of a Vec.
RunSize: PROC[r: Vector] RETURNS[Integer];
Regard r as a run vector; return the size of the expanded vector it encodes.
! MasterError[InvalidArgs] if r has odd length or nonzero lower bound
! MasterError[WrongType] if a run length in r is not an Integer
! MasterError[LimitExceeded] if the sum of the run lengths exceeds maxInteger
RunGet: PROC[r: Vector, i: Integer] RETURNS[Any];
Regard r as a run vector; get a value from the expanded vector it encodes.
! MasterError[InvalidArgs] if r has odd length or nonzero lower bound
! MasterError[WrongType] if a run length in r is not an Integer
! MasterError[BoundsFault] if i does not name an element of the expanded vector
END.