

















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


















E.g:- 123008907 hello Block# abc
E.g:- (i am a list)
(a ( a b c) d e f g h)
(father tom ( susan bill joe))
(sun mon tue wed thur fri sat)
( )
E.g:- " I am a string"
"a ba c d efg #$%^&!"
"Please enter the following details:" "Hello from 'Tutorials Point!"
Functions
Defun is used to define functions.
_( x x))_*
(+ x y))
Advantages of LISP
Areas of Application
program of factorial
Program of area of circle
Program to find max of three
numbers
(max 1 3 4 2 3) => 4
(min 1 3 4 2 3) => 1
Program of bubble sort
Program of structure
(defstruct student name rollno class )
Program of array creation
using the accessor function aref. As with hash tables, we can set individual items in the array using setf.
(setq my-array (make-array (list 3 3))) #2A((NIL NIL NIL) (NIL NIL NIL) (NIL NIL NIL))
(setf (aref my-array 0 0) "Dave") "Dave” (setf (aref my-array 0 1) "John") "John"
(aref my-array 0 0) "Dave" (aref my-array 0 1) "John"
program of FOR LOOP