descendant-of?

Name

descendant-of? -- Returns true if the child is some descendant of the specified node

Synopsis

(descendant-of? ancestor child)

Description

Returns #t if child is a descendant of ancestor.

Author

Norman Walsh, <ndw@nwalsh.com>

Source Code

(define (descendant-of? ancestor child)
  ;; Returns true if the child is some descendant of the specified node
  (let loop ((c child))
    (if (node-list-empty? c)
	#f
	(if (node-list=? ancestor c)
	    #t
	    (loop (parent c))))))