npm

npm’s 2019 JavaScript ecosystem survey analysis is now available! Get your copy here »

edge-lsharp

1.0.1 • Public • Published

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

install

npm i edge-lsharp

Downloadsweekly downloads

8

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability