DictionaryTestImpl.mesa
Copyright Ó 1990, 1992 by Xerox Corporation. All rights reserved.
Bill Jackson (bj), March 7, 1990 2:20 am PST
Willie-s, May 22, 1992 2:14 pm PDT
DIRECTORY
Commander USING [CommandProc, Register],
Convert USING [RopeFromAtom],
Dictionary,
IO USING [PutF1, PutRope, rope, STREAM],
Rope USING [ROPE],
SystemNames USING [UserName];
DictionaryTestImpl:
CEDAR
MONITOR
IMPORTS Commander, Convert, Dictionary, IO, SystemNames ~ {
ROPE: TYPE ~ Rope.ROPE;
DictionariesCmd: Commander.CommandProc ~ {
stdout: IO.STREAM ~ cmd.out;
user: ROPE ~ SystemNames.UserName[];
list: LIST OF Dictionary.Dictionary ~ Dictionary.Dictionaries[user];
stdout.PutRope["Dictionaries:\n"];
FOR tail:
LIST
OF Dictionary.Dictionary ¬ list, tail.rest
WHILE ( tail #
NIL )
DO
this: ROPE ~ Convert.RopeFromAtom[tail.first];
stdout.PutF1[" %g\n", IO.rope[this] ];
ENDLOOP;
};
LanguagesCmd: Commander.CommandProc ~ {
stdout: IO.STREAM ~ cmd.out;
user: ROPE ~ SystemNames.UserName[];
list: LIST OF Dictionary.Language ~ Dictionary.Languages[user];
stdout.PutRope["Languages:\n"];
FOR tail:
LIST
OF Dictionary.Language ¬ list, tail.rest
WHILE ( tail #
NIL )
DO
this: ROPE ~ Convert.RopeFromAtom[tail.first];
stdout.PutF1[" %g\n", IO.rope[this] ];
ENDLOOP;
};
StatusCmd: Commander.CommandProc ~ {
stdout: IO.STREAM ~ cmd.out;
status: ROPE ~ Dictionary.Status[];
stdout.PutF1["status: %g\n", IO.rope[status] ];
};
Commander.Register["Dictionary.Dictionaries", DictionariesCmd];
Commander.Register["Dictionary.Languages", LanguagesCmd];
Commander.Register["Dictionary.Status", StatusCmd];
}.