1
1
mirror of https://github.com/kanaka/mal.git synced 2024-11-10 12:47:45 +03:00
mal/es6/step0_repl.js

20 lines
334 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)); }
}