Page 1 of 1

Lisp function help

Posted: Wed May 16, 2012 5:11 pm
by g0blu324
This function works but I also need the condition that the path has to include the library.
(defun depth1 (queue finish)
(cond ((null queue) nil)
((equal finish (caar queue)) (print queue)
(reverse (car queue)))
(t (print queue)
(depth1 (append (expand (car queue)) (cdr queue)) finish))))

My attempt but didn't work:
(defun depth1 (queue finish)
(cond ((null queue) nil)
AND(((equal finish (caar queue))(member 'library queue)) (print queue)
(reverse (car queue)))
(t (print queue)
(depth1 (append (expand (car queue)) (cdr queue)) finish))))