RE: have-child? method

Subject: RE: have-child? method
From: "Harbarth, Juliane" <jhb@xxxxxxxxxxxxxx>
Date: Tue, 22 Jun 1999 12:46:10 +0200

> From: Guillaume Rouchy [mailto:rouchyg@xxxxxxxxxxxxxxxxxxxxxxxxxxx]
> I would like to know if a node contains a specific child. 

A node n posesses a child with gi c, iff
(have-child? c p) returns #t, with :

;
(define (have-child? c p)
	(process (children p) c))
;
(define (process nl c)
	(if (node-list-empty? nl)
		#f
		(if (equal? (gi (node-list-first nl)) c)
			#t
			(process (node-list-rest nl) c))))
;


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread