Skip to content

richorama/edge-lsharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

LSharp extension for edge.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published