File: example.1.gen

package info (click to toggle)
docbook-defguide 2.0.17%2Bsvn7549-3
  • links: PTS, VCS
  • area: main
  • in suites: lenny, squeeze
  • size: 101,040 kB
  • ctags: 261
  • sloc: xml: 426,495; perl: 4,471; python: 815; sh: 193; makefile: 181
file content (14 lines) | stat: -rw-r--r-- 502 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<example><title>A DSSSL Function</title>
<programlisting>
(define (node-list-filter-by-gi nodelist gilist)
  ;; Returns the node-list that contains every element of the original
  ;; nodelist whose gi is in gilist
  (let loop ((result (empty-node-list)) (nl nodelist))
    (if (node-list-empty? nl)
	result
	(if (member (gi (node-list-first nl)) gilist)
	    (loop (node-list result (node-list-first nl)) 
		  (node-list-rest nl))
	    (loop result (node-list-rest nl))))))
</programlisting>
</example>