Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

iamlisp

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iamlisp

Another one LISP interpreter.

  • 0.3.2
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

iamlisp

Another one my LISP-like language interpreter hosted on JS.

Syntax examples

Define variable

(def a 10 b 20)
(def foo "Hello World")
(def bar true)

Define function

(defun sum (a b) (+ a b))

Define macro

(defmacro backwards (. body) (eval (cons 'begin (.reverse 'body))))

Define lambda

(def my-lambda (lambda (a b) (+ a b)))

Iterative loop

; Print numbers from 100 to 0

(loop (x 100)
      (print x)
      (cond (> x 0) (recur (dec x))))

; Fibonacci using iterative loop

(defun fib (n)
  (loop (x 0 y 1 i n)
    (cond (<= i 0) x (recur y (+ x y) (dec i)))))

Define variable using list destructuring

; Nested destructuring
(def (a (b c)) '(2 '(4 6)))

; Destructuring with rest
(def (first . rest) '(1 2 3 4 5))

FAQs

Package last updated on 02 Jul 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc