Skip to content
Joshua Maxwell edited this page Nov 3, 2021 · 9 revisions

Welcome to the eLispsis wiki!

Table of Contents

  1. Core Functions
  2. Example2
  3. Third Example
  4. [Fourth Example](#fourth-example

Core Functions

Name Description Example
quote returns a literal of its parameter (quote Hello) => Hello
atom returns t if the parameter is atomic (not a list) (atom '(a b c d)) => ()
eq returns t if both parameters are equal (eq 'hi 'hi) => t
car returns the head of the list (car '(a b c d)) => a
cdr returns the tail of the list (cdr '(a b c d)) => (b c d)
cons prepends the first parameter to the second (cons 'w '(x y z)) => (w x y z)
cond returns first true statement (cond ('() 'no) ('t 'yes)) => yes
lambda returns a lambda function ((lambda (x) (+ x 1)) 2) => 3
defun defines a function (defun add1 (x) (+ x 1)) (add1 5) => 6
set defines a constant (set apple 'sauce) (print apple) => sauce
setq defines a quoted constant (setq fancy pants) (print fancy) => pants
print prints a value (print "Hello, world!") => Hello, World!
read gets user input and prints parameter (read "What's your name? ")
import imports an eLispsis file (path is relative to main.js) (import library/stdlib.el)
meta returns the result of a NodeJS statement (print (meta "4 + 5")) => 9
Clone this wiki locally