; Name: Christopher Higginbotham ; Date: 16 September 1999 ; Class: CSCI 322 ; MYUNION (defun MYUNION (list1 list2) (if (not (member (first list1) list2 :TEST #'EQUAL)) (setf list2 (cons (first list1) list2)) NIL ) (if (eq (rest list1) 'nil) list2 (MYUNION (rest list1) list2) ) ) ; MYINTERSECTION (defun MYINTERSECTION (list1 list2) (cond ( (member (first list1) list2 :TEST #'EQUAL) (cons (first list1) (MYINTERSECTION (rest list1) list2)) ) ( (not (eq list1 'nil)) (MYINTERSECTION (rest list1) list2) ) ) ) ; MYINTERSECTP (defun MYINTERSECTP (list1 list2) (if (not (member (first list1) list2 :TEST #'EQUAL)) (if (not (eq (rest list1) 'nil)) (MYINTERSECTP (rest list1) list2) NIL ) T ) ) ; MYSAMESETP (defun MYSAMESETP (list1 list2) (if (member (first list1) list2 :TEST #'EQUAL) (progn (setf list2 (remove (first list1) list2)) (setf list1 (remove (first list1) list1)) (if (eq list1 'nil) (if (eq list2 'nil) T NIL ) (MYSAMESETP list1 list2) ) ) NIL ) )