Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > 19bb6433bb07a8b16410504336791904 > files > 240

ocaml-doc-3.06-5mdk.ppc.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>

<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.06-7 of 2001-11-14">
<TITLE>
 The core library
</TITLE>
</HEAD>
<BODY TEXT=black BGCOLOR=white>
<A HREF="manual032.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A>
<A HREF="manual034.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%">
<TR><TD BGCOLOR="#2de52d"><DIV ALIGN=center><TABLE>
<TR><TD><A NAME="htoc241"><B><FONT SIZE=6>Chapter&nbsp;19</FONT></B></A></TD>
<TD WIDTH="100%" ALIGN=center><B><FONT SIZE=6>The core library</FONT></B></TD>
</TR></TABLE></DIV></TD>
</TR></TABLE> <A NAME="c:corelib"></A>
<BR>
This chapter describes the Objective Caml core library, which is
 composed of declarations for built-in types and exceptions, plus
the module <TT>Pervasives</TT> that provides basic operations on these
 built-in types. The <TT>Pervasives</TT> module is special in two
ways:
<UL><LI>
It is automatically linked with the user's object code files by
the <TT>ocamlc</TT> command (chapter&nbsp;<A HREF="manual022.html#c:camlc">8</A>).<BR>
<BR>
<LI>It is automatically ``opened'' when a compilation starts, or
when the toplevel system is launched. Hence, it is possible to use
unqualified identifiers to refer to the functions provided by the
<TT>Pervasives</TT> module, without adding a <TT>open Pervasives</TT> directive.
</UL>
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%">
<TR><TD BGCOLOR="#66ff66"><DIV ALIGN=center><TABLE>
<TR><TD><B><FONT SIZE=5>Conventions</FONT></B></TD>
</TR></TABLE></DIV></TD>
</TR></TABLE><BR>
The declarations of the built-in types and the components of module
<TT>Pervasives</TT> are printed one by one in typewriter font, followed by a
short comment. All library modules and the components they provide are
indexed at the end of this report.<BR>
<BR>
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%">
<TR><TD BGCOLOR="#66ff66"><DIV ALIGN=center><TABLE>
<TR><TD><A NAME="htoc242"><B><FONT SIZE=5>19.1</FONT></B></A></TD>
<TD WIDTH="100%" ALIGN=center><B><FONT SIZE=5>Built-in types and predefined exceptions</FONT></B></TD>
</TR></TABLE></DIV></TD>
</TR></TABLE><BR>
The following built-in types and predefined exceptions are always
defined in the
compilation environment, but are not part of any module. As a
consequence, they can only be referred by their short names.<BR>
<BR>
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%">
<TR><TD BGCOLOR="#7fff7f"><DIV ALIGN=center><TABLE>
<TR><TD><B><FONT SIZE=4>Built-in types</FONT></B></TD>
</TR></TABLE></DIV></TD>
</TR></TABLE>

<PRE>
 type int
</PRE>
<A NAME="@manual6"></A>
<BLOCKQUOTE>
 The type of integer numbers.
</BLOCKQUOTE>
<PRE>
 type char
</PRE>
<A NAME="@manual7"></A>
<BLOCKQUOTE>
 The type of characters.
</BLOCKQUOTE>
<PRE>
 type string
</PRE>
<A NAME="@manual8"></A>
<BLOCKQUOTE>
 The type of character strings.
</BLOCKQUOTE>
<PRE>
 type float
</PRE>
<A NAME="@manual9"></A>
<BLOCKQUOTE>
 The type of floating-point numbers.
</BLOCKQUOTE>
<PRE>
 type bool = false | true
</PRE>
<A NAME="@manual10"></A>
<BLOCKQUOTE>
 The type of booleans (truth values).
</BLOCKQUOTE>
<PRE>
 type unit = ()
</PRE>
<A NAME="@manual11"></A>
<BLOCKQUOTE>
 The type of the unit value.
</BLOCKQUOTE>
<PRE>
 type exn
</PRE>
<A NAME="@manual12"></A>
<BLOCKQUOTE>
 The type of exception values.
</BLOCKQUOTE>
<PRE>
 type 'a array
</PRE>
<A NAME="@manual13"></A>
<BLOCKQUOTE>
 The type of arrays whose elements have type <TT>'a</TT>.
</BLOCKQUOTE>
<PRE>
 type 'a list = [] | :: of 'a * 'a list
</PRE>
<A NAME="@manual14"></A>
<BLOCKQUOTE>
 The type of lists whose elements have type <TT>'a</TT>.
</BLOCKQUOTE>
<PRE>
type 'a option = None | Some of 'a
</PRE>
<A NAME="@manual15"></A>
<BLOCKQUOTE>
 The type of optional values of type <TT>'a</TT>. 
</BLOCKQUOTE>
<PRE>
type ('a, 'b, 'c) format
</PRE>
<A NAME="@manual16"></A>
<BLOCKQUOTE>
 The type of format strings. <TT>'a</TT> is the type of the parameters
 of the format, <TT>'c</TT> is the result type for the <TT>printf</TT>-style
 function, and <TT>'b</TT> is the type of the first argument given to
 <TT>\%a</TT> and <TT>\%t</TT> printing functions (see module <TT>Printf</TT>[<A >??</A>]).
</BLOCKQUOTE>
<PRE>
type 'a lazy_t
</PRE>
<A NAME="@manual17"></A>
<BLOCKQUOTE>
 This type is used to implement the <TT>Lazy</TT>[<A >??</A>] module.
 It should not be used directly.
</BLOCKQUOTE>
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%">
<TR><TD BGCOLOR="#7fff7f"><DIV ALIGN=center><TABLE>
<TR><TD><B><FONT SIZE=4>Predefined exceptions</FONT></B></TD>
</TR></TABLE></DIV></TD>
</TR></TABLE>

<PRE>
exception Match_failure of (string * int * int)
</PRE>
<A NAME="@manual18"></A>
<BLOCKQUOTE>
 Exception raised when none of the cases of a pattern-matching
 apply. The arguments are the location of the pattern-matching
 in the source code (file name, position of first character,
 position of last character).
</BLOCKQUOTE>
<PRE>
exception Assert_failure of (string * int * int)
</PRE>
<A NAME="@manual19"></A>
<BLOCKQUOTE>
 Exception raised when an assertion fails. The arguments are
 the location of the pattern-matching in the source code
 (file name, position of first character, position of last
 character).
</BLOCKQUOTE>
<PRE>
exception Invalid_argument of string
</PRE>
<A NAME="@manual20"></A>
<BLOCKQUOTE>
 Exception raised by library functions to signal that the given
 arguments do not make sense.
</BLOCKQUOTE>
<PRE>
exception Failure of string
</PRE>
<A NAME="@manual21"></A>
<BLOCKQUOTE>
 Exception raised by library functions to signal that they are
 undefined on the given arguments. 
</BLOCKQUOTE>
<PRE>
exception Not_found
</PRE>
<A NAME="@manual22"></A>
<BLOCKQUOTE>
 Exception raised by search functions when the desired object
 could not be found.
</BLOCKQUOTE>
<PRE>
exception Out_of_memory
</PRE>
<A NAME="@manual23"></A>
<BLOCKQUOTE>
 Exception raised by the garbage collector
 when there is insufficient memory to complete the computation.
</BLOCKQUOTE>
<PRE>
exception Stack_overflow
</PRE>
<A NAME="@manual24"></A>
<BLOCKQUOTE>
 Exception raised by the bytecode interpreter when the evaluation
 stack reaches its maximal size. This often indicates infinite
 or excessively deep recursion in the user's program.
 (Not fully implemented by the native-code compiler;
 see section&nbsp;<A HREF="manual025.html#s:compat-native-bytecode">11.4</A>.)
</BLOCKQUOTE>
<PRE>
exception Sys_error of string
</PRE>
<A NAME="@manual25"></A>
<BLOCKQUOTE>
 Exception raised by the input/output functions to report
 an operating system error.
</BLOCKQUOTE>
<PRE>
exception End_of_file
</PRE>
<A NAME="@manual26"></A>
<BLOCKQUOTE>
 Exception raised by input functions to signal that the
 end of file has been reached.
</BLOCKQUOTE>
<PRE>
exception Division_by_zero
</PRE>
<A NAME="@manual27"></A>
<BLOCKQUOTE>
 Exception raised by division and remainder operations
 when their second argument is null.
 (Not fully implemented by the native-code compiler;
 see section&nbsp;<A HREF="manual025.html#s:compat-native-bytecode">11.4</A>.)
</BLOCKQUOTE>
<PRE>
exception Sys_blocked_io
</PRE>
<A NAME="@manual28"></A>
<BLOCKQUOTE>
 A special case of <TT>Sys_error</TT> raised when no I/O is possible
 on a non-blocking I/O channel.
</BLOCKQUOTE>


<a HREF=libref/Pervasives.html> Module <tt>Pervasives</tt>: the initially opened module</a>
<BR>
<BR>

<BR>
<BR>
<HR>
<A HREF="manual032.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A>
<A HREF="manual034.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>