Page 61 - DCAP310_INTRODUCTION_TO_ARTIFICIAL_INTELLIGENCE_AND_EXPERT_SYSTEMS
P. 61
Unit 4: LISP
(ext:gc) force garbage collection Notes
Eval runtime evaluation
case-insensitive tokens (case-sensitivity (keywords, variable
identifiers...))
anything without a space and is not a tokens (variable identifier regexp)
number
hyphens tokens (what is the standard way for
scrunching together multiple words)
Setq variable assignment or declaration (assignment)
Setf variable assignment or declaration (assignment)
Set variable assignment or declaration (assignment)
let let* variable assignment or declaration (declaration)
flet labels defun defmethod defvar variable assignment or declaration (declaration)
defparameter defsetf ..
Functions
(lambda (a b) ...) anonymous function
(f a b ...) (apply f l) function call
(funcall f a b ...) function call
(f) function call (with no parameter)
(funcall f) function call (with no parameter)
no-applicable-method function called when a function is not defined
(in dynamic languages)
(defun f (para1 para2) ...) function definition
Return function return value (breaks the control flow)
Return-from xxx function return value (breaks the control flow)
no syntax needed function return value (function body is the
result)
identity identity function
Control Flow
/return-from xxx or return breaking control flow (continue/break)
go throw breaking control flow (goto (unconditional
jump))
Return breaking control flow (returning a value)
Return-from xxx breaking control flow (returning a value)
handler-bind handler-case ignore-errors exception (catching)
Unwind-protect exception (cleanup: code executed before
leaving)
Error exception (throwing)
Signal exception (throwing)
Cerror warn exception (throwing)
(if c ...) if_then
(if c b1 b2) if_then_else
(cond (c b1) (c2 b2) (t b3)) if_then_else
Contd...
LOVELY PROFESSIONAL UNIVERSITY 55