Mumble
Command: Commander.CommandProc ~ {
ENABLE Convert.Error => CommanderOps.Failed[cmd.procData.doc];
realArg: REAL ← 42.0;
intArg: INT ← 42;
fHead: LIST OF ROPE ~ LIST[NIL];
fLast: LIST OF ROPE ← fHead;
arg0: ROPE ← CommanderOps.NextArgument[cmd];
IF arg0 = NIL THEN CommanderOps.Failed[cmd.procData.doc];
FOR arg:
ROPE ← arg0, CommanderOps.NextArgument[cmd]
UNTIL arg =
NIL
DO
IF Rope.Match["-*", arg]
THEN {
FOR i:
INT
IN (0..Rope.Size[arg])
DO
SELECT Rope.Lower[Rope.Fetch[arg, i]]
FROM
'r => realArg ← Convert.RealFromRope[CommanderOps.NextArgument[cmd]];
'i => intArg ← Convert.IntFromRope[CommanderOps.NextArgument[cmd]];
ENDCASE => CommanderOps.Failed[cmd.procData.doc];
ENDLOOP;
}
ELSE {
fLast ← fLast.rest ← LIST[arg];
};
ENDLOOP;
IO.PutF[cmd.out, "-r %g -i %g %g\n", [real[realArg]], [integer[intArg]], [refAny[fHead.rest]]];
};