Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (setf (get 'car 'model) 'ford
- (get 'car 'motor) 'engine
- (get 'engine 'horse_power) 340
- (get 'engine 'cylinders) 8
- (get 'car 'seats) 4
- (get 'car 'wheels) 4
- (get 'car 'trunk) 'trunk
- (get 'trunk 'capacity) 50
- (get 'trunk 'content) nil
- )
- NIL
- (defun put_in_trunk (L)
- (cond ((eql (get 'trunk 'content) NIL) (setf (get 'trunk 'content) L))
- (T (setf (get 'trunk 'content) (append (get 'trunk 'content) L)))
- )
- )
- PUT_IN_TRUNK
- (get 'trunk 'content)
- NIL
- (defun get_from_trunk (item)
- (cond ((null item) nil)
- ((null (get 'trunk 'content)) nil)
- (T (mapcar (lambda (i)
- (cond ((null i) nil)
- ((null (member i (get 'trunk 'content))) nil)
- (T (setf (get 'trunk 'content) (delete i (get 'trunk 'content))))
- ))
- item))
- )
- )
- GET_FROM_TRUNK
- (defun change_car_model (N)
- (cond ((> (length N) 1) nil)
- ((null n) nil)
- (T (setf (get 'car 'model) (car N)))
- )
- )
- CHANGE_CAR_MODEL
- (defun change_horse_power (x)
- (cond ((numberp x)
- (cond ((> x 0) (setf (get 'engine 'horse_power) x))
- (T nil)))
- (T nil)
- )
- )
- CHANGE_HORSE_POWER
- (defun change_cylinders_number (x)
- (cond ((numberp x)
- (cond ((> x 0) (setf (get 'engine 'cylinders) x))
- (T nil)))
- (T nil)
- )
- )
- CHANGE_CYLINDERS_NUMBER
- (defun change_seats_number (x)
- (cond ((numberp x)
- (cond ((> x 0) (setf (get 'engine 'seats) x))
- (T nil)))
- (T nil)
- )
- )
- CHANGE_SEATS_NUMBER
- (defun change_wheels_number (x)
- (cond ((numberp x)
- (cond ((> x 0) (setf (get 'engine 'wheels) x))
- (T nil)))
- (T nil)
- )
- )
- CHANGE_WHEELS_NUMBER
Advertisement
Add Comment
Please, Sign In to add comment