mirror of
https://github.com/kanaka/mal.git
synced 2024-09-20 01:57:09 +03:00
a05c086f05
- Use Vector class derived from Array - Use Array/Vector.from for initializing/cloning of Array/Vector - Remove most semi-colon line endings - More use of arrow functions - Use Object.assign to copy properties in _malfunc and function cloning. - Remove or inline a bunch of types.js functions that don't really need to be separate functions: _obj_type, _sequential_Q, _symbol, _symbol_Q, _vector, _vector_Q, _hash_map, _hash_map_Q - Simplify dependency list in Makefile - Remove some separate core.js functions by moving them into the core_ns declaration: _nth, keys, vals, with_meta. With node 7, babel is mostly just used for translating imports into CommonJS requires for node.
20 lines
327 B
JavaScript
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)) }
|
|
}
|