ABS - Absolute Value
(ABS -5)
5
APPEND
Merges lists
(APPEND `((A B)(C D)))
Answer (A B C D)
ATOM
Tests an argument to see if it is an atom
(ATOM `(A B C D))
Answer NIL
(ATOM `A)
Answer T
CAR
Takes the first element of list
(CAR `(ONE TWO))
Answer ONE
CDR
Remove the first element of list
(CDR `(ONE TWO THREE))
Answer TWO THREE
CONS
Adds a new first element to a list
(CONS `A (Q Z))
Answer (A Q Z)
"DEFine FUNction", use DEFUN to create custom procedures
DEFUN
Creates user defined functions
Example:
(DEFUN ADD2 (x y) (+ x y))
Creates a function called ADD2 that takes two parameters
x and y and adds them. To use:
(ADD2 3 4)
Answer 7
EVAL
Evaluates and expression:
(EVAL NUMBER)
23
EXPT - Calculates Powers
(EXPT 3 2)
9
LIST
Makes a new list of several lists
(LIST `((A B)(C D)))
Answer ((A B)(C D))
LISTP
Tests an argument to see if it is a list
(LISP `(A B C D))
Answer T
(LISTP `A)
Answer NIL
LOAD or :LD
Loading a saved script into the interpreter.
MEMBERP
Tests to see if an ATOM is a member of a list.
MAX - Largest number in sequence
(MAX 2 5 6)
5
MIN - Smallest number in sequence
(MIN 2 5 6)
2
NULL
Tests to see if an argument is an empty list
(NULL '())
Answer T
(NULL '(A B C))
Answer NIL
NIL
Universal false.
Boolean response for "false"
QUOTE
Prints list item(s)
(QUOTE `(COLORS))
Answer YELLOW RED GREEN
SETQ
Assigns values:
(SETQ NUMBER `32)
Associates a list with a list name:
(SETQ COLORS `(YELLOW RED GREEN))
SQRT - Square Root
(SQRT 16)
4.0
T
Universal true.
Boolean response for "true"