<?xml version="1.0"?>
<chapter id="readline-module" xmlns:xi="http://www.w3.org/2003/XInclude">
    <chapterinfo>
    <author>
      <firstname>Robert</firstname>
      <surname>Carr</surname>
      <affiliation>
	<address>
	  <email>racarr@<parameter>gnome.org</parameter></email>
	</address>
      </affiliation>
    </author>
  </chapterinfo>
  <title>readline</title>

  <refsect1>
    <title>API Reference</title>
    <para>
      The readline module allows for basic usage of the GNU readline library, in Seed. More advanced features may be added a a later time. In order to use the readline module it must be first imported.
      <programlisting>
	readline = imports.readline;
      </programlisting>
    </para>
    
    <xi:include href="readline-funcs.xml"/>
  </refsect1>
  <refsect1>
    <title>Examples</title>
    <para>Below are several examples of using the Seed readline module. For additional resources, consult the examples/ folder of the Seed source</para>
    <example id="readline-repl-example">
      <para>This demonstrates a simple REPL using the readline module</para>
      <programlisting>
readline = imports.readline;
while (1){
  try{
    eval(readline.readline("> "));
  }
  catch(e) {
    print(e.name + " " + e.message);
  }
}
      </programlisting>
    </example>
  </refsect1>
</chapter>

