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

<RefMeta>
  <RefEntryTitle>decrement-list-members</RefEntryTitle>
  <RefMiscInfo Role="file">dblib.dsl</RefMiscInfo>
</RefMeta>

<RefNameDiv>
  <RefName>decrement-list-members</RefName>
  <RefPurpose>Decrement each member of a list</RefPurpose>
</RefNameDiv>

<RefSynopsisDiv><Title>Synopsis</Title>
<Synopsis>
(decrement-list-members vlist #!optional (decr 1) (floor 0))
</Synopsis>
</RefSynopsisDiv>

<RefSect1><Title>Description</Title>

<para>
Decrement all the values of a list by <literal>decr</literal>, not to fall below <literal>floor</literal>.
</para>
<variablelist>
<varlistentry><term><literal>vlist</literal></term>
<listitem>
<para>
The list of values.  All the values of this list should be numeric.
</para>
</listitem>
</varlistentry>
<varlistentry><term><literal>decr</literal></term>
<listitem>
<para>
The amount by which each element of the list should be decremented.
The default is 1.
</para>
</listitem>
</varlistentry>
<varlistentry><term><literal>floor</literal></term>
<listitem>
<para>
The value below which each member of the list is not allowed to fall.
The default is 0.
</para>
</listitem>
</varlistentry>
</variablelist>

</RefSect1>

<RefSect1><Title>Author</Title>

<para>
David Carlisle</para>
</RefSect1>
<RefSect1><Title>Source Code</Title>

<ProgramListing>
(define (decrement-list-members vlist #!optional (decr 1) (floor 0))
  ;; Decrement each member of a list
  (map (lambda (a) 
	 (if (<= a (+ decr floor))
	     floor
	     (- a decr)))
       vlist))
</ProgramListing>
</RefSect1>

</RefEntry>
