| Did you know ... | Search Documentation: |
| Referring to predicates from a message |
Many messages refer to a predicate. Rather than formatting the
predicate indicator yourself, use the grammar rules below. They are
defined in the system module $messages and are declared
public, i.e., they must be called with an explicit module
qualification. Using them makes the reference consistent with the
messages of the system: the predicate indicator is written using the
code style class and, if the source location of the
predicate is known, it becomes a hyperlink to its definition on
terminals that support this (see section
2.5 and the Prolog flag
hyperlink_term). This works for predicates defined in C as well,
provided the system can resolve the address of the implementing
function.
prolog:message(no_such_predicate(PI)) -->
[ 'There is no ' ],
'$messages':predicate_reference(PI).
////// notation. Options:
auto (default), hide or show.
Using
auto, the module qualification is removed if it is user,
system or a system internal module.false, do not create a hyperlink. Default is true.code.true, add a tag that indicates the kind of the
predicate. Default is false. This is intended for messages
that list candidate predicates, one per line.//iso, built_in, foreign,
library(Name), module(Module), user
or
undefined. This is the classification used by the
tag(true) option above. Fails if Spec does not
denote a predicate.