B. Course, Name, Survey on Board
(Name, SSN, Employer, Day Phone, Instructor for 723, A*/IDA*/NLP knowledge, interests)
B. CLtR available on-line (clman from UNIX, M-m or M-x clman from emacs)
C. Some Lisp Tutorial (or notes).
D. Norvig optional but excellent. (Will not cover explicitly in class).
E. For others, see handout on Lisp References.
B. Emacs (See handouts)
C. Prefer Email
D. ~hall/class/Set-Up-Account - optional but highly recommended.
B. AI: Search, trees, A*, Production Rules, NLP
C. Lisp: Quoting/evaluation, defun, passing functions, recursion, everything on handout (will review today).
B. Weighted HW's
C. No exams
D. Questions strongly encouraged in class (but don't dominate)
B. A+ = 4.1
A = 4.0
A- = 3.7
B+ = 3.3
etc. (0.3 for +/-)
C. Factors:
ii. Quality of Code (Defined more throughout semester)
ii. Code in Texts: Reference it, explain it extra thoroughly, preferably rewrite some.
B. Abstractions (High Level Datatypes, Functional Programming)
C. Functions as First-Class Objects (Higher-Order functions, applicative programming)
D. Recursion
E. Object-Oriented Programming
F. Macros (program generation facility, syntax extender)
B. Evaluation
ii. Symbols: Value of variable
iii. Lists: First entry is a function name, to be applied to evaluated arguments
iv. Exception: QUOTE, SETQ [If *goal* is side-effect, then it is an exception. But you don't usually get fooled]
D. Style: Indentation is important. Compare the following (on handout):
Point: removing most of the parens and leaving correct indentation is much more readable than leaving the parens and having wrong indentation.
Putting close parens on their own line is poor style in Lisp. Reason: in procedural languages, begin/end of a procedure is important thing. In Lisp, you have composition of functions, so nesting level is most important thing, and indentation gives that visual cue.
E. Defun:
SQUARE, AT-RANDOM, ADD-3
functional style, avoid globals, read re "let/let*"
F. List Functions
ii. Access: first, second, ... , tenth, last, rest, nth, subseq, butlast, etc.
ii. [Magic] Assume it works for some arbitrary size (call this N-1)
iii. Show how to solve size N problem, given function works on size N-1 or smaller
Factorial, Last-Element, Every-Other, Length-Of
(loop for I from 1 to 5 do (print I))
(loop for I in '(A B C D)) do (print I))
Can use RETURN to break out of loop
(loop for I from 1 to 9 by 2 do (print I) finally (return I))
ii. apply [Add all grades]
iii. funcall
iv. find [find first C via below 80]
v. find-if [same thing]