-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the eLispsis wiki!
- Core Functions
- Example2
- Third Example
- [Fourth Example](#fourth-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
|
---|