DIRECTORY
Commander USING [CommandProc, Register],
IO USING [STREAM, PutF, --GetLineRope, --SkipWhitespace, GetChar, GetInt, char],
Try:
CEDAR
PROGRAM
IMPORTS Commander, IO = BEGIN
InputSlice:
TYPE =
RECORD [
input: SEQUENCE numInputs: NAT OF CHAR -- '0, '1, or 'x
];
OutputSlice:
TYPE =
RECORD [
output: SEQUENCE numOutputs: NAT OF CHAR -- '0, '1, or 'x
];
ProductTerm:
TYPE =
RECORD [
inputs: InputSlice,
outputs: OutputSlice
];
TruthTable:
TYPE =
RECORD [
row: SEQUENCE numRows: NAT OF OutputSlice
];
Xy:
PROC [n:
INT]
RETURNS [Rope.
ROPE] =
BEGIN
RETURN["abc"];
END;
Test: Commander.CommandProc =
BEGIN
tt: REF TruthTable ← NEW[TruthTable[50]];
DO
i, j: NAT;
c, d: CHAR;
cmd.out.PutF["Type something:"];
[] ← cmd.in.SkipWhitespace[];
d ← cmd.in.GetChar[];
i ← cmd.in.GetInt[];
j ← cmd.in.GetInt[];
c ← tt[i][j];
tt[i][j] ← d;
cmd.out.PutF["Done...%g/%g\n", IO.char[d], IO.char[c]];
ENDLOOP;
END;
Commander.Register[key: "mayo", proc: Test, doc: "test program"];
END.