2.15.1 Variations of the PREDICATE macro (version 2)
The PREDICATE() macros have a number of variations that deal with special cases.
- PREDICATE0(name)
- This is the same as PREDICATE(name, 0). It avoids a compiler warning
about that
PL_av
is not used. - NAMED_PREDICATE(plname, cname, arity)
- This version can be used to create predicates whose name is not a valid
C++ identifier. Here is a ---hypothetical--- example, which unifies the
second argument with a stringified version of the first. The‘cname'
is used to create a name for the functions. The concrete name does not
matter, but must be unique. Typically it is a descriptive name using the
limitations imposed by C++ indentifiers.
NAMED_PREDICATE("#", hash, 2) { A2 = (wchar_t*)A1; }
- PREDICATE_NONDET(name, arity)
- Define a non-deterministic Prolog predicate in C++. See also section 2.15.2.
- NAMED_PREDICATE_NONDET(plname, cname, arity)
- Define a non-deterministic Prolog predicate in C++, whose name is not a
valid C++ identifier. See also section
2.15.2.