Section "java"

The specifics mainly deal with the number blending that is applied in the Dogelog Player for the Java platform. Whereas Prolog atoms are simply mapped to Javat String class, the mapping of Prolog integers is towards Java Integer class and JavaScript BigInteger class. Exclusion of NaN and infinites from Prolog floats, is done by mapping values to errors.

The following mapping from Prolog to Java is used:

Prolog Atomic
+--- Prolog Atom
+--- Java String
+--- Prolog Number
+--- Prolog integer
+---- Java Integer
+---- Java BigInteger
+--- Prolog float
+---- Java Double
+--- Prolog 0rNone Reference
+--- Java null
+--- Prolog 0rFalse Reference
+--- Java Boolean.FALSE
+--- Prolog 0rTrue Reference
+--- Java Boolean.TRUE

The following Java specific calls are provided:

is_bigint(T): (host language)
Check whether the object T is a Java BigInteger.
norm_smallint(T): (host language)
Return the Java long T normalized to a Prolog integer.
norm_bigint(T): (host language)
Return the Java BigInteger T normalized to a Prolog integer.
norm_float(T): (host language)
Return Java float T normalized to a Prolog number.
widen_bigint(T): (host language)
Return the Prolog integer T widened to a Java BigInteger.

Kommentare