DSSSL Library Reference: Part of the Modular DocBook Stylesheet distribution
Prev |  | Next

# nth-node

## Name

nth-node -- Return a specific node in a node list (by numeric index)

## Synopsis

    (nth-node nl k)

## Description

Returns the `k`th node in `nl`. The first node in the node list has the index "1".

## Author

Norman Walsh, <ndw@nwalsh.com>

## Source Code

    (define (nth-node nl k)
      ;; Return a specific node in a node list (by numeric index)
      (if (equal? k 1)
          (node-list-first nl)
          (nth-node (node-list-rest nl) (- k 1))))

Prev | Home | Next
dingbat | Up | constant-list