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