This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

Lisp function help

1 post · 3082 views

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))))