LSharp extension for edge.js
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
src
.gitignore
.npmignore
package.json
readme.md

readme.md

edge-lsharp

Run lisp (LSharp) in node.js with edge.js.

Example

Write a factorial function in lisp, and call it from JavaScript:

var edge = require('edge');
var fact = edge.func('lsharp', function(){/*

(def fact(n) 
	(if (is n 0) 1 (* n (fact (- n 1)))))

*/});

fact([5], function(err, answer){
	console.log(answer);
	// = 120
});

Installation

$ npm install edge
$ npm install edge-lsharp

Usage

Pass the lisp code in as either a comment (as above), a string, or a filename (as below):

var edge = require('edge');
var lisp = edge.func('lsharp', 'lisp-func.ls');

lisp(['arg1', 'arg2'], function(err, result){
	
});

Evaluate a function in lisp, and write to the console:

var edge = require('edge');
var ls = edge.func('lsharp', '(prn "Hello, World")');

ls([], function(err){
	// Hello, World
});

License

MIT