<?xml version="1.0" ?>
<!DOCTYPE refentry>
<refentry xmlns="http://docbook.org/ns/docbook"
          version="4.5">
  <refnamediv>
    <refname>FOLDL</refname>
    <refpurpose>reduce a journal to a single value</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <synopsis>FOLDL <replaceable>journal</replaceable>
USING <replaceable>name</replaceable>
FROM <replaceable>extension</replaceable></synopsis>
  </refsynopsisdiv>

  <refsect1>
    <title>Description</title>

    <para>
      <command>FOLDL</command> traverses a journal, keeping an accumulator that
      is updated by an extension, and finally returns the accumulator.
    </para>
  </refsect1>

  <refsect1>
    <title>Options</title>

    <variablelist>
      <varlistentry>
        <term><replaceable>journal</replaceable></term>
        <listitem>
          <para>
            The name of the journal to traverse. The journal must already exist.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><replaceable>name</replaceable></term>
        <listitem>
          <para>
            The name of the program from the extension to use. For some
            extensions (such as Lua), this is not the name but the source code
            of the program.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><replaceable>extension</replaceable></term>
        <listitem>
          <para>
            The extension to call the program from.
          </para>
        </listitem>
      </varlistentry>
    </variablelist>
  </refsect1>

  <refsect1>
    <title>Response</title>

    <para>
      <command>FOLDL</command> returns a single response part with the final
      accumulator, and nothing else.
    </para>
  </refsect1>
</refentry>
