implement

This commit is contained in:
darkf 2013-12-17 01:32:43 -08:00
parent 31013f8ea7
commit 0e8eae2a40
1 changed files with 11 additions and 0 deletions

View File

@ -10,6 +10,11 @@ ADMINS = ["darkf"].
-- channels to join
CHANS = ["#lobby"].
-- the lexical environment that $eval uses
EVAL_ENV = [("loop", loop),
("repr", repr),
("itos", itos)].
-- First we'll define some helper functions
map(f, []) -> [].
@ -137,6 +142,12 @@ handleMessage(s, nick, chan, "$savefacts") -> do
s
end.
handleMessage(s, nick, chan, "$eval "::line) -> do
ret = eval(line, EVAL_ENV);
say(chan, nick + ": " + repr(ret));
s
end.
handleMessage(s, nick, chan, "$join "::j) -> do
if isAdmin(nick) then do
fputstr(sock, "JOIN " + j + "\r\n");