Sophie

Sophie

distrib > Mageia > 7 > i586 > media > core-release > by-pkgid > 6b3585ea67ce3e79c9049b5b33294cdd > files > 628

docbook-style-dsssl-doc-1.79-16.mga7.noarch.rpm

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

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

<RefNameDiv>
  <RefName>constant-list</RefName>
  <RefPurpose>Returns a list of the specified value</RefPurpose>
</RefNameDiv>

<RefSynopsisDiv><Title>Synopsis</Title>
<Synopsis>
(constant-list value length)
</Synopsis>
</RefSynopsisDiv>

<RefSect1><Title>Description</Title>

<para>
Return a list containing <literal>length</literal> elements, each of <literal>value</literal>.</para>


</RefSect1>

<RefSect1><Title>Author</Title>

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

<ProgramListing>
(define (constant-list value length)
  ;; Returns a list of the specified value
   (let loop ((count (abs length)) (result '()))
     (if (equal? count 0)
         result
         (loop (- count 1) (cons value  result)))))
</ProgramListing>
</RefSect1>

</RefEntry>