4.4 Comparison
- int PlTerm::operator ==(const PlTerm &t)
- int PlTerm::operator !=(const PlTerm &t)
- int PlTerm::operator <(const PlTerm &t)
- int PlTerm::operator >(const PlTerm &t)
- int PlTerm::operator <=(const PlTerm &t)
- int PlTerm::operator >=(const PlTerm &t)
- Compare the instance with t and return the result according to the Prolog defined standard order of terms.
- int PlTerm::operator ==(long num)
- int PlTerm::operator !=(long num)
- int PlTerm::operator <(long num)
- int PlTerm::operator >(long num)
- int PlTerm::operator <=(long num)
- int PlTerm::operator >=(long num)
- Convert PlTerm to a
longand perform standard C-comparison between the two long integers. If PlTerm cannot be converted atype_erroris raised. - int PlTerm::operator ==(const wchar_t *)
- int PlTerm::operator ==(const char *)
- Yields
TRUEif the PlTerm is an atom or string representing the same text as the argument,FALSEif the conversion was successful, but the strings are not equal and antype_errorexception if the conversion failed.
Below are some typical examples. See section 6 for direct manipulation of atoms in their internal representation.
A1 < 0 | Test A1 to hold a Prolog integer or float that can be transformed lossless to an integer less than zero. |
A1 < PlTerm(0) | A1
is before the term `0' in the `standard order of terms'. This means that
if A1 represents an atom, this test yields TRUE. |
A1 == PlCompound("a(1)") | Test A1
to represent the term
a(1). |
A1 == "now" | Test A1 to be an atom or string holding the text ``now''. |