(define (ipreced nl) ;; Implements ipreced as per ISO/IEC 10179:1996 (node-list-map (lambda (snl) (let loop ((prev (empty-node-list)) (rest (siblings snl))) (cond ((node-list-empty? rest) (empty-node-list)) ((node-list=? (node-list-first rest) snl) prev) (else (loop (node-list-first rest) (node-list-rest rest)))))) nl))