[Commit] nickle/doc/tutorial/builtins io.sgml,1.1,1.2 math.sgml,1.1,1.2 strings.sgml,1.1,1.2

commit at keithp.com commit at keithp.com
Fri Jun 6 16:26:25 PDT 2003


Committed by: p186

Update of /local/src/CVS/nickle/doc/tutorial/builtins
In directory home.keithp.com:/tmp/cvs-serv11636/doc/tutorial/builtins

Modified Files:
	io.sgml math.sgml strings.sgml 
Log Message:
Changed lists to synopses.  Tour subsection removed.  Got repository up-to-date.



Index: io.sgml
===================================================================
RCS file: /local/src/CVS/nickle/doc/tutorial/builtins/io.sgml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- io.sgml	23 May 2003 23:48:59 -0000	1.1
+++ io.sgml	6 Jun 2003 22:26:23 -0000	1.2
@@ -11,9 +11,9 @@
 For many functions in File, there is a top-level builtin which assumes one of these standard streams.
 Other files may be read and written by opening them:
 </para>
-<itemizedlist>
-<listitem><para>file open(string path, string mode)</para></listitem>
-</itemizedlist>
+<synopsis>
+file open(string path, string mode)
+</synopsis>
 <para>
 The first string gives the path to the file to be opened; the second is one of:
 </para>
@@ -32,9 +32,9 @@
 Nickle can also open pipes to other programs, reading or writing to their stdouts or stdins; these are also treated as <literal>file</literal>s, and the difference is transparent to the functions that manipulate them.
 Pipes are opened with <literal>pipe</literal> rather than <literal>open</literal>; otherwise they are treated identically to flat files.
 </para>
-<itemizedlist>
-<listitem><para>file pipe(string path, string[*] argv, string mode)</para></listitem>
-</itemizedlist>
+<synopsis>
+file pipe(string path, string[*] argv, string mode)
+</synopsis>
 <para>
 The first string refers to the program to be run; <literal>argv</literal> is an array of the arguments to pass to it.
 By convention, <literal>argv[0]</literal> should be the name of the program.
@@ -55,9 +55,9 @@
 <para>
 When a file is no longer needed, it should be closed.
 </para>
-<itemizedlist>
-<listitem><para>void close(file f)</para></listitem>
-</itemizedlist>
+<synopsis>
+void close(file f)
+</synopsis>
 <informalexample><screen>
 > File::close ( ls );
 </screen></informalexample>
@@ -68,44 +68,54 @@
 Output written to a file is not immediately written, but buffered until an appropriate time.
 Ordinarily, this is not noticed; if, however, it is important to know that all buffers have been written to a file, they can be flushed:
 </para>
-<itemizedlist>
-<listitem><para>void flush (file f)</para></listitem>
-</itemizedlist>
+<synopsis>
+void flush (file f)
+</synopsis>
 </sect2>
 
 <sect2><title>End</title>
 <para>
 Returns true if the file is at end-of-file, otherwise returns false.
 </para>
-<itemizedlist>
-<listitem><para>bool end (file f)</para></listitem>
-</itemizedlist>
+<synopsis>
+bool end (file f)
+</synopsis>
 </sect2>
 
 <sect2><title>Characters and strings</title>
 <para>
 Individual characters can be read and written using <literal>getc</literal>, <literal>getchar</literal>, <literal>putc</literal>, and <literal>putchar</literal>.
 </para>
-<itemizedlist>
-<listitem><para>int getc(file f)</para></listitem>
-<listitem><para>int getchar()</para></listitem>
-<listitem><para>int putc(int c,file f)</para></listitem>
-<listitem><para>void putchar(int c)</para></listitem>
-</itemizedlist>
+<synopsis>
+int getc(file f)
+</synopsis>
+<synopsis>
+int getchar()
+</synopsis>
+<synopsis>
+int putc(int c,file f)
+</synopsis>
+<synopsis>
+void putchar(int c)
+</synopsis>
 <para>
 A character can be pushed back onto the stream with <literal>ungetc</literal> or <literal>ungetchar</literal>.
 </para>
-<itemizedlist>
-<listitem><para>int ungetc(int c, file f)</para></listitem>
-<listitem><para>int ungetchar(int c)</para></listitem>
-</itemizedlist>
+<synopsis>
+int ungetc(int c, file f)
+</synopsis>
+<synopsis>
+int ungetchar(int c)
+</synopsis>
 <para>
 Strings can be read, a line at a time, using <literal>fgets</literal> and <literal>gets</literal>.
 </para>
-<itemizedlist>
-<listitem><para>string fgets(file f)</para></listitem>
-<listitem><para>string gets()</para></listitem>
-</itemizedlist>
+<synopsis>
+string fgets(file f)
+</synopsis>
+<synopsis>
+string gets()
+</synopsis>
 <para>
 All of these are like their C counterparts, with the exception noted in the following section.
 </para>
@@ -124,11 +134,15 @@
 Therefore, unlike in C, <emphasis>characters cannot be counted on to be the same as bytes</emphasis>.
 For this reason, Nickle provides the following functions:
 </para>
-<itemizedlist>
-<listitem><para>int putb(int c,file f)</para></listitem>
-<listitem><para>int getb(file f)</para></listitem>
-<listitem><para>int ungetb(file f)</para></listitem>
-</itemizedlist>
+<synopsis>
+int putb(int c,file f)
+</synopsis>
+<synopsis>
+int getb(file f)
+</synopsis>
+<synopsis>
+int ungetb(file f)
+</synopsis>
 <para>
 These operate the same as <literal>putc</literal>, <literal>getc</literal>, and <literal>ungetc</literal>, but will always read or write one byte at a time, regardless of character representation.
 </para>

Index: math.sgml
===================================================================
RCS file: /local/src/CVS/nickle/doc/tutorial/builtins/math.sgml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- math.sgml	23 May 2003 23:48:59 -0000	1.1
+++ math.sgml	6 Jun 2003 22:26:23 -0000	1.2
@@ -32,11 +32,15 @@
 </para>
 
 <sect3><title>Logarithms</title>
-<itemizedlist>
-<listitem><para>real log ( real a )</para></listitem>
-<listitem><para>real log10 ( real a )</para></listitem>
-<listitem><para>real log2 ( real a )</para></listitem>
-</itemizedlist>
+<synopsis>
+real log ( real a )
+</synopsis>
+<synopsis>
+real log10 ( real a )
+</synopsis>
+<synopsis>
+real log2 ( real a )
+</synopsis>
 <para>
 The logarithm of <literal>a</literal> in base e, ten, and two, respectively.
 <informalexample><screen>
@@ -53,14 +57,24 @@
 </sect3>
 
 <sect3><title>Trigonometric functions</title>
-<itemizedlist>
-<listitem><para>real sin ( real a )</para></listitem>
-<listitem><para>real cos ( real a )</para></listitem>
-<listitem><para>real tan ( real a )</para></listitem>
-<listitem><para>real asin ( real a )</para></listitem>
-<listitem><para>real acos ( real a )</para></listitem>
-<listitem><para>real atan ( real a )</para></listitem>
-</itemizedlist>
+<synopsis>
+real sin ( real a )
+</synopsis>
+<synopsis>
+real cos ( real a )
+</synopsis>
+<synopsis>
+real tan ( real a )
+</synopsis>
+<synopsis>
+real asin ( real a )
+</synopsis>
+<synopsis>
+real acos ( real a )
+</synopsis>
+<synopsis>
+real atan ( real a )
+</synopsis>
 <para>
 The sine, cosine, and tangent of <literal>a</literal>, and the inverse functions.
 <informalexample><screen>
@@ -75,10 +89,12 @@
 </sect3>
 
 <sect3><title>Constants</title>
-<itemizedlist>
-<listitem><para>protected real e</para></listitem>
-<listitem><para>real pi</para></listitem>
-</itemizedlist>
+<synopsis>
+protected real e
+</synopsis>
+<synopsis>
+real pi
+</synopsis>
 <para>
 <literal>pi</literal> and <literal>e</literal> define the usual constants (3.14..., 2.72...).
 <literal>e</literal> is protected and must be called <literal>Math::e</literal> to allow ordinary use of the name <literal>e</literal>.

Index: strings.sgml
===================================================================
RCS file: /local/src/CVS/nickle/doc/tutorial/builtins/strings.sgml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- strings.sgml	23 May 2003 23:48:59 -0000	1.1
+++ strings.sgml	6 Jun 2003 22:26:23 -0000	1.2
@@ -40,10 +40,12 @@
 Those are the integer representations of each character; they are most likely in ASCII, but not necessarily--see the section on Unicode in the I/O section.
 The String namespace provides <literal>new</literal> to recreate a string from these integer character representations, regardless of ASCII or Unicode:
 </para>
-<itemizedlist>
-<listitem><para>string new(int c)</para></listitem>
-<listitem><para>string new(int[*] cv)</para></listitem>
-</itemizedlist>
+<synopsis>
+string new(int c)
+</synopsis>
+<synopsis>
+string new(int[*] cv)
+</synopsis>
 <para>
 For instance,
 <informalexample><screen>
@@ -75,9 +77,9 @@
 </para>
 
 <sect3><title>Length</title>
-<itemizedlist>
-<listitem><para>int length ( string s )</para></listitem>
-</itemizedlist>
+<synopsis>
+int length ( string s )
+</synopsis>
 <para>
 Returns the number of characters in <literal>s</literal>.
 For example,
@@ -91,10 +93,12 @@
 </sect3>
 
 <sect3><title>Index</title>
-<itemizedlist>
-<listitem><para>int index ( string t, string p )</para></listitem>
-<listitem><para>int rindex ( string t, string p )</para></listitem>
-</itemizedlist>
+<synopsis>
+int index ( string t, string p )
+</synopsis>
+<synopsis>
+int rindex ( string t, string p )
+</synopsis>
 <para>
 Returns the index of the first occurence of the substring <literal>p</literal> in <literal>t</literal>, or -1 if <literal>p</literal> is not in <literal>t</literal>; <literal>rindex</literal> returns the last occurance instead.
 For example,
@@ -111,9 +115,9 @@
 </sect3>
 
 <sect3><title>Substr</title>
-<itemizedlist>
-<listitem><para>string substr ( string s, int i, int l )</para></listitem>
-</itemizedlist>
+<synopsis>
+string substr ( string s, int i, int l )
+</synopsis>
 <para>
 Returns the substring of <literal>s</literal> which begins at index <literal>i</literal> and is <literal>l</literal> characters long.
 If <literal>l</literal> is negative, returns the substring of that length which preceeds <literal>i</literal> instead.




More information about the Commit mailing list