0.2.0 • Published 9 years ago
lisp-to-array v0.2.0
lisp-to-array
Transpiles lisp code to an array
Install
$ npm install --save lisp-to-array
or, to install it globally:
$ npm install -g lisp-to-array
Usage
io.js / node.js
var lispToArray = require("lisp-to-array");
console.log(lispToArray("(this is an \"example\" 42)"));
should output:
["this", "is", "an", ["`", "example"], 42]
global
Assuming the file test.lisp with the following content:
(do (def console (js console)) (. console "log" 42))
$ lisp-to-array test.lisp
$ lisp-to-array -o test.json test.lisp
$ lisp-to-array -e test.lisp
should output:
["do", ["def", "console", ["js", "console"]], [".", "console", ["`", "log"], 42]]
42
undefined
and should write into test.json:
["do", ["def", "console", ["js", "console"]], [".", "console", ["`", "log"], 42]]
Example
(this is an "example" 42)
compiles to:
["this", "is", "an", ["`", "example"], 42]