diff options
author | elioat <elioat@tilde.institute> | 2023-03-03 10:21:04 -0500 |
---|---|---|
committer | elioat <elioat@tilde.institute> | 2023-03-03 10:21:04 -0500 |
commit | 2dd6313dfc5ca90da8a235d6bc170f6a62d6ba3c (patch) | |
tree | 4edaf0f57e439f33256b18d670fc6c54aeb81a30 /lisp/js/repl.js | |
parent | 22798d2fde16c47e11fd4df32433f21d71872f7d (diff) | |
download | tour-2dd6313dfc5ca90da8a235d6bc170f6a62d6ba3c.tar.gz |
very tiny lisp
Diffstat (limited to 'lisp/js/repl.js')
-rw-r--r-- | lisp/js/repl.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lisp/js/repl.js b/lisp/js/repl.js new file mode 100644 index 0000000..6ea6929 --- /dev/null +++ b/lisp/js/repl.js @@ -0,0 +1,11 @@ +// lifted from https://github.com/maryrosecook/littlelisp +var repl = require("repl"); +var lisp = require("./lisp").lisp; + +repl.start({ + prompt: "* ", + eval: function (cmd, context, filename, callback) { + var ret = lisp.interpret(lisp.parse(cmd)); + callback(null, ret); + }, +}); |