| The Modular DocBook Stylesheets | ||
|---|---|---|
| Prev | DSSSL Library | Next |
(list-head inputlist k)
Returns the list that contains the first k elements of inputlist.
(list-head (1 2 3 4) 2) returns (1 2).
Norman Walsh, <norm@berkshire.net>
(define (list-head inputlist k)
;; Return the head of a list
(let loop ((l inputlist) (count k) (result '()))
(if (<= count 0)
result
(loop (cdr l) (- count 1) (append result (list (car l)))))))| Prev | Home | Next |
| list->string | Up | list-member-find |
Copyright © 1997, 1998 Norman Walsh