node-list-filter-by-not-gi

Name

node-list-filter-by-not-gi -- Returns selected elements from a node list

Synopsis

(node-list-filter-by-not-gi nodelist gilist)

Description

Returns a node list containing all the nodes from nodelist whose GIs are NOT members of gilist. The order of nodes in the node list is preserved.

Author

Norman Walsh, <ndw@nwalsh.com>

Source Code

(define (node-list-filter-by-not-gi nodelist gilist)
  ;; Returns selected elements from a node list
  (let loop ((result (empty-node-list)) (nl nodelist))
    (if (node-list-empty? nl)
	result
	(if (member (gi (node-list-first nl)) gilist)
	    (loop result (node-list-rest nl))
	    (loop (node-list result (node-list-first nl))
		  (node-list-rest nl))))))