Socket
Book a DemoInstallSign in
Socket

minilisp

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minilisp

Small and minimalistic LISP interpreter

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

minilisp

Small minimalistic LISP interpreter

npm install minilisp

Usage

const minilisp = require('minilisp')

// Define your functions.
// Notice all values/statements are functions that can be resolved lazily.
const lisp = minilisp(function (name) {
  if (name === '+') {
    return function (a, b) {
      return a() + b()
    }
  }
  if (name === '-') {
    return function (a, b) {
      return a() - b()
    }
  }
})

// Compile your program
const prog = lisp(`
  (+ 1 (- 3 2))
`)

// And run it
console.log(prog()) // prints 2!

License

MIT

FAQs

Package last updated on 06 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts