Quantcast
Channel: Hacker News
Viewing all articles
Browse latest Browse all 25817

Embeddable lisp interpreter that implements call/cc, written in TypeScript

$
0
0

README.md

Embeddable lisp interpreter that implements call/cc, written in TypeScript.

Installation

npm install --save lisp-interpreter

Usage

import { repl } from"../index";repl(["do",
    ["set", "make-greeter", ["vau", ["x"], "xenv",
        ["vau", ["y"], "yenv", ["cons", ["eval", "x", "yenv"], ["eval", "y", "xenv"]]]]],
    ["set", "greeter", ["let", [["z", ["quote", "a"]]], ["make-greeter", "z"]]],
    ["let", [["z", ["quote", "b"]]], ["greeter", "z"]]
]);

Note that an implementation of lambda is missing. It can be easily implemented using vau.

Contributing

Feel free to send pull requests.

License

ISC License

Copyright 2017 Florian Max Junker <hello@fmjunker.com>

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.

Viewing all articles
Browse latest Browse all 25817

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>