0.1.1 • Published 9 years ago

lispster v0.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

LISPster.js

A lisp in javascript. Without the transpilation.

Installation

Via npm/browserify:

npm i --save lispster

Usage

Here is a stupid example while I find something smarter:

var lispster = require("lispster");
var lisp = lispster.lispster;
var lambda = lispster.lambda;
var v = lispster.v;
var letVar = lispster.letVar;

function add(a, b) {
  return a + b;
}

function mul(a, b) {
  return a * b;
}

var myLispFunction = lisp(
  [lambda, ["x", "y", "z"],
    [letVar, {added: [add,
                       [v, "x"],
                       [v, "y"]]},
      [mul, [v, "added"], [v, "z"]]]]
);

myLispFunction(1, 2, 3); // => 9

Note that lispster is completely interoperable with JS.

Test & contribute

You'll need io.js in order to test this library.

After that it's easy:

git clone git@github.com:rricard/lispster.git
cd lispster
npm i
npm t

Once you're able to test, PRs are welcome!

Author

Robin Ricard

License

MIT

0.1.1

9 years ago

0.1.0

9 years ago