Sophie

Sophie

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

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               - Message printing primitives</TITLE>
</HEAD>
<BODY> 
Go to the <A HREF="ciao_1.html">first</A>, <A HREF="ciao_29.html">previous</A>, <A HREF="ciao_31.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="SEC174" HREF="ciao_toc.html#TOC174">Message printing primitives</A></H1>
<P>
<A NAME="IDX2058"></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#194 (2003/12/19, 16:56:0 CET)


<P>
This module provides predicates for printing in a unified way informational messages, and also for printing some terms in a specific way.



<UL>
<LI><A HREF="ciao_30.html#SEC175">Usage and interface (io_aux)</A>
<LI><A HREF="ciao_30.html#SEC176">Documentation on exports (io_aux)</A>
<LI><A HREF="ciao_30.html#SEC177">Known bugs and planned improvements (io_aux)</A>
</UL>



<H2><A NAME="SEC175" HREF="ciao_toc.html#TOC175">Usage and interface (<CODE>io_aux</CODE>)</A></H2>

<div class="cartouche">

<UL>

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

These predicates are builtin in Ciao, so nothing special has to be done to use them.

<LI><STRONG>Exports:</STRONG>


<UL>

<LI><EM>Predicates:</EM>

<A NAME="IDX2059"></A>
<CODE>message/2</CODE>, 
<A NAME="IDX2060"></A>
<CODE>message_lns/4</CODE>, 
<A NAME="IDX2061"></A>
<CODE>error/1</CODE>, 
<A NAME="IDX2062"></A>
<CODE>warning/1</CODE>, 
<A NAME="IDX2063"></A>
<CODE>note/1</CODE>, 
<A NAME="IDX2064"></A>
<CODE>message/1</CODE>, 
<A NAME="IDX2065"></A>
<CODE>debug/1</CODE>, 
<A NAME="IDX2066"></A>
<CODE>inform_user/1</CODE>, 
<A NAME="IDX2067"></A>
<CODE>display_string/1</CODE>, 
<A NAME="IDX2068"></A>
<CODE>display_list/1</CODE>, 
<A NAME="IDX2069"></A>
<CODE>display_term/1</CODE>.

</UL>

</UL>

</div class="cartouche">



<H2><A NAME="SEC176" HREF="ciao_toc.html#TOC176">Documentation on exports (<CODE>io_aux</CODE>)</A></H2>
<P>
<A NAME="IDX2070"></A>
<A NAME="IDX2071"></A>
<DL>
<DT><span class="define">PREDICATE:</span> <B>message/2:</B>
<DD><A NAME="IDX2072"></A>


<P>
<CODE>message(Type, Message)</CODE>


<P>
Output to standard error <CODE>Message</CODE>, which is of type <CODE>Type</CODE>. The <CODE>quiet</CODE> 
<A NAME="IDX2073"></A>
<A NAME="IDX2074"></A>
<EM>prolog flag</EM> (see section <A HREF="ciao_27.html#SEC163">Changing system behaviour and various flags</A>) controls which messages are actually output, depending on its type. Also, for <CODE>error</CODE>, <CODE>warning</CODE> and <CODE>note</CODE> messages, a prefix is output which denotes the severity of the message. <CODE>Message</CODE> is an item or a list of items from this list: 
<DL COMPACT>

<DT><CODE>$$(String)</CODE>
<DD>
<CODE>String</CODE> is a string, which is output with 
<A NAME="IDX2075"></A>
<CODE>display_string/1</CODE>. 

<DT><CODE>"(Term)</CODE>
<DD>
<CODE>Term</CODE> is output quoted. If the module 
<A NAME="IDX2076"></A>
<CODE>write</CODE> is loaded, the term is output with 
<A NAME="IDX2077"></A>
<CODE>writeq/1</CODE>, else with 
<A NAME="IDX2078"></A>
<CODE>displayq/1</CODE>. 

<DT><CODE>~~(Term)</CODE>
<DD>
<CODE>Term</CODE> is output unquoted. If the module 
<A NAME="IDX2079"></A>
<CODE>write</CODE> is loaded, the term is output with 
<A NAME="IDX2080"></A>
<CODE>write/1</CODE>, else with 
<A NAME="IDX2081"></A>
<CODE>display/1</CODE>. 

<DT><CODE>[](Term)</CODE>
<DD>
<CODE>Term</CODE> is recursively output as a message, can be an item or a list of items from this list. 

<DT><CODE>Term</CODE>
<DD>
Any other term is output with 
<A NAME="IDX2082"></A>
<CODE>display/1</CODE>. 
</DL>

<P>
<STRONG>Usage:</STRONG> <CODE>message(Type, Message)</CODE>

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

<CODE>Type</CODE> is an atom.
 (<CODE>basic_props:atm/1</CODE>)

<CODE>Type</CODE> is an element of <CODE>[error,warning,note,message,debug]</CODE>.
 (<CODE>basic_props:member/2</CODE>)
</UL>

</DL>

<P>
<A NAME="IDX2083"></A>
<A NAME="IDX2084"></A>
<DL>
<DT><span class="define">PREDICATE:</span> <B>message_lns/4:</B>
<DD><A NAME="IDX2085"></A>


<P>
<CODE>message_lns(Type, L0, L1, Message)</CODE>


<P>
Output to standard error <CODE>Message</CODE>, which is of type <CODE>Type</CODE>, and occurs between lines <CODE>L0</CODE> and <CODE>L1</CODE>. This is the same as 
<A NAME="IDX2086"></A>
<CODE>message/2</CODE>, but printing the lines where the message occurs in a unified way (this is useful because automatic tools such as the emacs mode know how to parse them).


<P>
<STRONG>Usage:</STRONG> <CODE>message_lns(Type, L0, L1, Message)</CODE>

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

<CODE>Type</CODE> is an atom.
 (<CODE>basic_props:atm/1</CODE>)

<CODE>Type</CODE> is an element of <CODE>[error,warning,note,message,debug]</CODE>.
 (<CODE>basic_props:member/2</CODE>)
</UL>

</DL>

<P>
<A NAME="IDX2087"></A>
<A NAME="IDX2088"></A>
<DL>
<DT><span class="define">PREDICATE:</span> <B>error/1:</B>
<DD><A NAME="IDX2089"></A>


<P>
Defined as 

<PRE>
error(Message) :-
        message(error,Message).
</PRE>

<P>
.


</DL>

<P>
<A NAME="IDX2090"></A>
<A NAME="IDX2091"></A>
<DL>
<DT><span class="define">PREDICATE:</span> <B>warning/1:</B>
<DD><A NAME="IDX2092"></A>


<P>
Defined as 

<PRE>
warning(Message) :-
        message(warning,Message).
</PRE>

<P>
.


</DL>

<P>
<A NAME="IDX2093"></A>
<A NAME="IDX2094"></A>
<DL>
<DT><span class="define">PREDICATE:</span> <B>note/1:</B>
<DD><A NAME="IDX2095"></A>


<P>
Defined as 

<PRE>
note(Message) :-
        message(note,Message).
</PRE>

<P>
.


</DL>

<P>
<A NAME="IDX2096"></A>
<A NAME="IDX2097"></A>
<DL>
<DT><span class="define">PREDICATE:</span> <B>message/1:</B>
<DD><A NAME="IDX2098"></A>


<P>
Defined as 

<PRE>
message(Message) :-
        message(message,Message).
</PRE>

<P>
.


</DL>

<P>
<A NAME="IDX2099"></A>
<A NAME="IDX2100"></A>
<DL>
<DT><span class="define">PREDICATE:</span> <B>debug/1:</B>
<DD><A NAME="IDX2101"></A>


<P>
Defined as 

<PRE>
debug(Message) :-
        message(debug,Message).
</PRE>

<P>
.


</DL>

<P>
<A NAME="IDX2102"></A>
<A NAME="IDX2103"></A>
<DL>
<DT><span class="define">PREDICATE:</span> <B>inform_user/1:</B>
<DD><A NAME="IDX2104"></A>


<P>
<CODE>inform_user(Message)</CODE>


<P>
Similar to 
<A NAME="IDX2105"></A>
<CODE>message/1</CODE>, but <CODE>Message</CODE> is output with 
<A NAME="IDX2106"></A>
<CODE>display_list/1</CODE>. This predicate is obsolete, and may disappear in future versions.


</DL>

<P>
<A NAME="IDX2107"></A>
<A NAME="IDX2108"></A>
<DL>
<DT><span class="define">PREDICATE:</span> <B>display_string/1:</B>
<DD><A NAME="IDX2109"></A>


<P>
<CODE>display_string(String)</CODE>


<P>
Output <CODE>String</CODE> as the sequence of characters it represents.


<P>
<STRONG>Usage:</STRONG> <CODE>display_string(String)</CODE>

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

<CODE>String</CODE> is a string (a list of character codes).
 (<CODE>basic_props:string/1</CODE>)
</UL>

</DL>

<P>
<A NAME="IDX2110"></A>
<A NAME="IDX2111"></A>
<DL>
<DT><span class="define">PREDICATE:</span> <B>display_list/1:</B>
<DD><A NAME="IDX2112"></A>


<P>
<CODE>display_list(List)</CODE>


<P>
Outputs <CODE>List</CODE>. If <CODE>List</CODE> is a list, do 
<A NAME="IDX2113"></A>
<CODE>display/1</CODE> on each of its elements, else do 
<A NAME="IDX2114"></A>
<CODE>display/1</CODE> on <CODE>List</CODE>.


</DL>

<P>
<A NAME="IDX2115"></A>
<A NAME="IDX2116"></A>
<DL>
<DT><span class="define">PREDICATE:</span> <B>display_term/1:</B>
<DD><A NAME="IDX2117"></A>


<P>
<CODE>display_term(Term)</CODE>


<P>
Output <CODE>Term</CODE> in a way that a 
<A NAME="IDX2118"></A>
<CODE>read/1</CODE> will be able to read it back, even if operators change.


</DL>



<H2><A NAME="SEC177" HREF="ciao_toc.html#TOC177">Known bugs and planned improvements (<CODE>io_aux</CODE>)</A></H2>


<UL>

<LI>

<A NAME="IDX2119"></A>
<CODE>message/2</CODE> assumes that a module with name 'write' is library(write).
</UL>

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