The Modular DocBook Stylesheets | ||
---|---|---|
Prev | DSSSL Library | Next |
(decrement-list-members vlist #!optional (decr 1) (floor 0))
Decrement all the values of a list by decr, not to fall below floor.
The list of values. All the values of this list should be numeric.
The amount by which each element of the list should be decremented. The default is 1.
The value below which each member of the list is not allowed to fall. The default is 0.
(decrement-list-members (0 1 2 3 4 5)) => (0 0 1 2 3 4).
Norman Walsh, <norm@berkshire.net>
(define (decrement-list-members vlist #!optional (decr 1) (floor 0)) ;; Decrement each member of a list (let loop ((curlist vlist) (result '())) (if (equal? (length curlist) 0) result (loop (cdr curlist) (append result (list (if (<= (car curlist) floor) (car curlist) (- (car curlist) decr))))))))
Prev | Home | Next |
copy-string | Up | default-lowercase-list |
Copyright © 1997, 1998 Norman Walsh