Go to the first, previous, next, last section, table of contents.


Message printing primitives

Author(s): Daniel Cabeza.

Version: 1.11#222 (2004/5/24, 13:8:7 CEST)

Version of last change: 1.11#72 (2003/12/19, 16:56:14 CET)

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

Usage and interface (io_aux)

Documentation on exports (io_aux)

PREDICATE: message/2:

message(Type, Message)

Output to standard error Message, which is of type Type. The quiet prolog flag (see section Changing system behaviour and various flags) controls which messages are actually output, depending on its type. Also, for error, warning and note messages, a prefix is output which denotes the severity of the message. Message is an item or a list of items from this list:

$$(String)
String is a string, which is output with display_string/1.
"(Term)
Term is output quoted. If the module write is loaded, the term is output with writeq/1, else with displayq/1.
~~(Term)
Term is output unquoted. If the module write is loaded, the term is output with write/1, else with display/1.
[](Term)
Term is recursively output as a message, can be an item or a list of items from this list.
Term
Any other term is output with display/1.

Usage: message(Type, Message)

PREDICATE: message_lns/4:

message_lns(Type, L0, L1, Message)

Output to standard error Message, which is of type Type, and occurs between lines L0 and L1. This is the same as message/2, 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).

Usage: message_lns(Type, L0, L1, Message)

PREDICATE: error/1:

Defined as

error(Message) :-
        message(error,Message).

.

PREDICATE: warning/1:

Defined as

warning(Message) :-
        message(warning,Message).

.

PREDICATE: note/1:

Defined as

note(Message) :-
        message(note,Message).

.

PREDICATE: message/1:

Defined as

message(Message) :-
        message(message,Message).

.

PREDICATE: debug/1:

Defined as

debug(Message) :-
        message(debug,Message).

.

PREDICATE: inform_user/1:

inform_user(Message)

Similar to message/1, but Message is output with display_list/1. This predicate is obsolete, and may disappear in future versions.

PREDICATE: display_string/1:

display_string(String)

Output String as the sequence of characters it represents.

Usage: display_string(String)

PREDICATE: display_list/1:

display_list(List)

Outputs List. If List is a list, do display/1 on each of its elements, else do display/1 on List.

PREDICATE: display_term/1:

display_term(Term)

Output Term in a way that a read/1 will be able to read it back, even if operators change.

Known bugs and planned improvements (io_aux)


Go to the first, previous, next, last section, table of contents.