Lisp




Background on LISP



Running LISP


LISP is Functional



Syntax for Evaluating Functions


More Arithmetic Operators: - and *


Numeric Types


Composition of Function Calls


Some Math Functions


Variable Number of Parameters


Some Errors



Syntax


Strings



Boolean Type


Numeric Comparison



Logical Operators: and, or, not



Functions and, or are Short Circuit



Functions and, or, Return Last Evaluated Function


Print



If Evaluates to a Value



If Does Not Evaluates Both Parts



If: Some Syntax



Lists



List Functions: First Look



Evaluating a List


Self-Evaluating Forms



Quote



Quote Shorthand



Quote and Car



Car, Cdr, Cons



CDR



More Examples with CAR and CDR



Cons



More on Quote




Defining New Functions


Recursion



Other Functions

Evaluate to t
Evaluate to nil
(numberp 55)
(numberp 'a)


(symbolp 'a)
(symbolp '(a b))
(symbolp 'nil) (symbolp ''nil)
(symbolp '())
(symbolp nil)


(listp  '(a))
(listp 'a)
(listp  ())
(listp nil)
(listp 'nil)
(listp  '())
(listp  ''())


(atom 'a) (atom '(a))
(atom 3)
(atom nil)
(atom 'nil)

(atom ())



(null nil)
(null 'a)
(null () )
(null '(a))
(null 'nil)
(null ''nil)


Cond


Length Function Using Cond


More on Cond


Member Function

(defun member (x l)
(
... what goes here?
)
)

Comparisons with Function Equal


Equal and Eq


Equal and Member


Eval



Map and Lambda


Functional Languages and Referential Transparency


Setq and Prog and Loop and Do and Case and ...