Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > by-pkgid > 2fc07611b08d4a735fd34d5eb60d8e16 > files > 2096

ciao-1.10p8-3mdv2010.0.i586.rpm

<HTML>
<HEAD>
<!-- Created by texi2html 1.56k + clip patches and <A href="http://www.clip.dia.fi.upm.es/Software">lpdoc</A> from ciao.texi on 28 January 2007 -->

<LINK rel="stylesheet" href="ciao.css" type="text/css">
<TITLE>The Ciao Prolog System               - Directives for using code in other files</TITLE>
</HEAD>
<BODY> 
Go to the <A HREF="ciao_1.html">first</A>, <A HREF="ciao_14.html">previous</A>, <A HREF="ciao_16.html">next</A>, <A HREF="ciao_241.html">last</A> section, <A HREF="ciao_toc.html">table of contents</A>.
<P><HR><P>


<H1><A NAME="SEC125" HREF="ciao_toc.html#TOC125">Directives for using code in other files</A></H1>
<P>
<A NAME="IDX1200"></A>


<P>
<STRONG>Author(s):</STRONG> Daniel Cabeza.


<P>
<STRONG>Version:</STRONG> 1.10#7 (2006/4/26, 19:22:13 CEST)


<P>
<STRONG>Version of last change:</STRONG> 1.9#30 (2002/11/20, 14:15:12 CET)


<P>
Documentation for the directives used to load code into Ciao Prolog (both from the toplevel shell and by other modules).



<UL>
<LI><A HREF="ciao_15.html#SEC126">Usage and interface (loading_code)</A>
<LI><A HREF="ciao_15.html#SEC127">Documentation on internals (loading_code)</A>
</UL>



<H2><A NAME="SEC126" HREF="ciao_toc.html#TOC126">Usage and interface (<CODE>loading_code</CODE>)</A></H2>

<div class="cartouche">

<UL>

<LI><STRONG>Library usage:</STRONG>

These directives are builtin in Ciao, so nothing special has to be done to use them.
</UL>

</div class="cartouche">



<H2><A NAME="SEC127" HREF="ciao_toc.html#TOC127">Documentation on internals (<CODE>loading_code</CODE>)</A></H2>
<P>
<A NAME="IDX1201"></A>
<A NAME="IDX1202"></A>
<DL>
<DT><span class="define">DECLARATION:</span> <B>ensure_loaded/1:</B>
<DD><A NAME="IDX1203"></A>


<P>
<STRONG>Usage:</STRONG> :- <CODE>ensure_loaded(File)</CODE>.
<KBD> * ISO * </KBD>

<UL>
<LI><EM>Description:</EM> Specifies that the code present in <CODE>File</CODE> will be included in the executable being prepared, in the <CODE>user</CODE> module. The file <CODE>File</CODE> cannot have a module declaration. This directive is intended to be used by programs not divided in modules. Dividing programs into modules is however strongly encouraged, since most of the attractive features of Ciao (such as static debugging and global optimization) are only partially available for <CODE>user</CODE> modules.

<LI><EM>The following properties should hold at call time:</EM>

<CODE>File</CODE> is a source name.
 (<CODE>streams_basic:sourcename/1</CODE>)
</UL>

</DL>

<P>
<A NAME="IDX1204"></A>
<A NAME="IDX1205"></A>
<DL>
<DT><span class="define">DECLARATION:</span> <B>include/1:</B>
<DD><A NAME="IDX1206"></A>


<P>
<STRONG>Usage:</STRONG> :- <CODE>include(File)</CODE>.
<KBD> * ISO * </KBD>

<UL>
<LI><EM>Description:</EM> The contents of the file <CODE>File</CODE> are included in the current program text exactly as if they had been written in place of this directive.

<LI><EM>The following properties should hold at call time:</EM>

<CODE>File</CODE> is a source name.
 (<CODE>streams_basic:sourcename/1</CODE>)
</UL>

</DL>

<P>
<A NAME="IDX1207"></A>
<A NAME="IDX1208"></A>
<DL>
<DT><span class="define">DECLARATION:</span> <B>use_package/1:</B>
<DD><A NAME="IDX1209"></A>


<P>
:- <CODE>use_package(Package)</CODE>.


<P>
Specifies the use in this file of the packages defined in <CODE>Package</CODE>. See the description of the third argument of 
<A NAME="IDX1210"></A>
<CODE>module/3</CODE> for an explanation of 
<A NAME="IDX1211"></A>
package files. 


<P>
This directive must appear the first in the file, or just after a 
<A NAME="IDX1212"></A>
<CODE>module/3</CODE> declaration. A file with no module declaration, in the absence of this directive, uses an implicit package <CODE>default</CODE> (see section <A HREF="ciao_33.html#SEC187">Other predicates and features defined by default</A>).


<P>
<STRONG>Usage 1:</STRONG> :- <CODE>use_package(Package)</CODE>.

<UL>
<LI><EM>The following properties should hold at call time:</EM>

<CODE>Package</CODE> is a source name.
 (<CODE>streams_basic:sourcename/1</CODE>)
</UL>

<P>
<STRONG>Usage 2:</STRONG> :- <CODE>use_package(Package)</CODE>.

<UL>
<LI><EM>The following properties should hold at call time:</EM>

<CODE>Package</CODE> is a list of <CODE>sourcename</CODE>s.
 (<CODE>basic_props:list/2</CODE>)
</UL>

</DL>

<P><HR><P>
Go to the <A HREF="ciao_1.html">first</A>, <A HREF="ciao_14.html">previous</A>, <A HREF="ciao_16.html">next</A>, <A HREF="ciao_241.html">last</A> section, <A HREF="ciao_toc.html">table of contents</A>.
</BODY>
</HTML>