

































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
List Processing Language, List Process, Variations, Valid objects, Predicates, Set Operations, Iteration, Dotimes and dolist, Property Lists, Arrays, Functional Programming Paradigm are key points of this lecture. Programming languages is basic subject of computer science. Its not about any specific language but almost cover all of them.
Typology: Slides
1 / 41
This page cannot be seen from the preview
Don't miss anything!
Valid objects (S-expression)
Valid objects (S-expression)
(sqrt 4) 2
(sqrt x) Error: The variable X is unbound.
(+ (sqrt 4) 4.0)
(setq x 3.0)
x
(setq y x)
; the value of x is assigned as the value of y
y
(+ x y)
Functions:
( cons 'x L) ; insert symbol x at the front of list L, which is (X A B C) ; (A B C) - >( list 'a 'b 'c) ; making a list with the arguments as its elements (A B C) ; if a, b, c have values A, B, C, then (list a b c) ; returns list (A B C) - >( append '(a b) '(c d)) (A B C D) ; appends one list in front of another
Functions: (cont’)
Functions (cont’)
Predicates
predicate is false, T or anything other than NIL, otherwise
Defining LISP functions
(defun y-plus (x) (+ x y)) ;definition of y-plus
(setq y 2) (y-plus 23) 25