Merge pull request #281 from sebras/master
[jackhill/mal.git] / es6 / step0_repl.js
1 import { readline } from './node_readline'
2
3 // read
4 const READ = str => str
5
6 // eval
7 const EVAL = (ast, env) => ast
8
9 // print
10 const PRINT = exp => exp
11
12 // repl
13 const REP = str => PRINT(EVAL(READ(str), {}))
14
15 while (true) {
16 let line = readline('user> ')
17 if (line == null) break
18 if (line) { console.log(REP(line)) }
19 }