DoIt: Commander.CommandProc ~ {
effects: Creates a new MEDDLE expression viewer with label from command line.
local declarations
name: Rope.ROPE ← ""; -- label for viewer
filter all garbage characters out of command line for viewer name
FOR i:
INT
IN [0..cmd.commandLine.Length[] - 1]
DO
c: CHAR ← cmd.commandLine.Fetch[i];
IF c IN ['\040..'\176] THEN name ← Rope.Cat[name, Rope.FromChar[c]];
ENDLOOP;
IF name.Length[] = 0 THEN name ← "MEDDLE Expr";
[] ← ViewExpr.Create[NIL, name];
};
Commander.Register[key: "MeddleOpen", proc: DoIt, doc: "Opens a new MEDDLE math expression editor viewer."];