<RefEntry id="ipreced">
<!-- This file is generated automatically from the DSSSL source. -->
<!-- Do not edit this file! -->
<?html-filename ipreced.html>

<RefMeta>
  <RefEntryTitle>ipreced</RefEntryTitle>
  <RefMiscInfo Role="file">dblib.dsl</RefMiscInfo>
</RefMeta>

<RefNameDiv>
  <RefName>ipreced</RefName>
  <RefPurpose>Implements ipreced as per ISO/IEC 10179:1996</RefPurpose>
</RefNameDiv>

<RefSynopsisDiv><Title>Synopsis</Title>
<Synopsis>
(ipreced nl)
</Synopsis>
</RefSynopsisDiv>

<RefSect1><Title>Description</Title>

<para>
Implements <literal>ipreced</literal> as per ISO/IEC 10179:1996</para>


</RefSect1>

<RefSect1><Title>Author</Title>

<para>
From ISO/IEC 10179:1996</para>
</RefSect1>
<RefSect1><Title>Source Code</Title>

<ProgramListing>
(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))
</ProgramListing>
</RefSect1>

</RefEntry>
