blob: 2f10a7e97957acee787c2fa35af3b9028cf3326f (
plain) (
tree)
|
|
# a little lisp
Most of this lifed from <https://github.com/maryrosecook/littlelisp>, <https://maryrosecook.com/blog/post/little-lisp-interpreter>.
To run interactively:
```bash
node repl.js
```
To run in the browser:
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>lisp</title>
<script src="lisp.js" type="text/javascript"></script>
</head>
<body>
<script>
const ret = lisp.run(
`(print
(add 3 3))`
);
</script>
</body>
</html>
```
`lisp.run()` is a convinence, it wraps `lisp.interpret(lisp.parse())`.
See also:
- <https://github.com/hundredrabbits/Ronin>
- <https://github.com/lctrt/nanolisp/>
|