I have just noticed that the following succeeds:
?- X is 3r7, rational(X), number(X), atomic(X), \+atom(X), format("~q",[X]).
The documentation for
number/1 still says
As rational numbers are not atomic in the current implementation and we do not want to break the rule that number/1 implies atomic/1, number/1 fails on rational numbers. This will change if rational numbers become atomic.
Well, the rational numbers are atomic now.
Btw, is there a way to “inspect” the “integer” that is currently in an
X. To decide whether it is a machine integer or an integer from GMP. A bit in the spirit of
float_parts/4. I can’t directly think of a use for that, but having an inspection trap to the bilge is always good.