|Did you know ...||Search Documentation:|
|Other foreign interface types|
Atoms are the central representation for textual constants in Prolog. The transformation of a character string C to an atom implies a hash-table lookup. If the same atom is needed often, it is advised to store its reference in a global variable to avoid repeated lookup.
int64_tis defined in the
stdint.hstandard header and provides platform-independent 64-bit integers. Portable code accessing Prolog should use this type to exchange integer values. Please note that PL_get_long() can return
FALSEon Prolog integers that cannot be represented as a C long. Robust code should not assume any of the integer fetching functions to succeed, even if the Prolog term is known to be an integer.
As of SWI-Prolog 7.3.12, the arity of terms has changed from
size_t. To deal with this transition, all affecting
functions have two versions, where the old name exchanges the arity as
and a new function with name *_sz() exchanges the arity as
size_t. If the C macro PL_ARITY_AS_SIZE is defined before
SWI-Prolog.h, macros are put in place that map the
old names to the new functions. Without precautions, the old code is
compatible, but the following warning is printed when compiling:
#warning "Term arity has changed from int to size_t." #warning "Please update your code and use #define PL_ARITY_AS_SIZE 1."
To make the code compile silently again, include
as below and change the types you use to represent arity from
size_t. Please be aware that
#define PL_ARITY_AS_SIZE #include <SWI-Prolog.h>