1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-21 10:37:58 +03:00
mal/es6/step0_repl.mjs
2017-09-28 08:35:05 -05:00

20 lines
327 B
JavaScript

import { readline } from './node_readline'
// read
const READ = str => str
// eval
const EVAL = (ast, env) => ast
// print
const PRINT = exp => exp
// repl
const REP = str => PRINT(EVAL(READ(str), {}))
while (true) {
let line = readline('user> ')
if (line == null) break
if (line) { console.log(REP(line)) }
}