Commit | Line | Data |
---|---|---|
891c3f3b JM |
1 | readline = require "./node_readline.coffee" |
2 | ||
3 | # read | |
4 | READ = (str) -> str | |
5 | ||
6 | # eval | |
7 | EVAL = (ast, env) -> ast | |
8 | ||
9 | ||
10 | PRINT = (exp) -> exp | |
11 | ||
12 | # repl | |
13 | rep = (str) -> PRINT(EVAL(READ(str), {})) | |
14 | ||
15 | # repl loop | |
16 | while (line = readline.readline("user> ")) != null | |
17 | continue if line == "" | |
18 | console.log rep line | |
19 | ||
20 | # vim: ts=2:sw=2 |