0.0.6 • Published 12 years ago
LISP.js v0.0.6
LISP.js
Parse and execute LISP code in JavaScript.
API
For parsing the code, the parse
function can be used.
This will return an array with all pieces.
parse('(+ 2 3)'); // ['+', 2, 3]
Executing code can be done with the exec
function:
exec('(+ 3 (- 10 5))'); // 8
AMD
LISP.js uses the AMD format. You could use any compatible AMD loader, either on Node.js or in the browser to use this Complex module. I'd recommend Require.JS.
Concatenating AMD modules can be done with r.js or amd-packager-php
LISP.js in Node.js
For usage in node.js, amd-loader
is required. This can be installed by running npm install
.
Then amd-loader
should be required in your own file:
require('amd-loader');
var exec = require('LISP.js/exec');
exec('(+ 1 2)');