ObjectToTermConverter

Converts a JVM/Kotlin value into its Prolog Term representation -- the direction opposite to TermToObjectConverter -- e.g. as needed to turn the return value of a reflectively invoked method (Ref.invoke) back into something a Prolog computation can unify against.

The default implementation maps null to ObjectRef.NULL, String to it.unibo.tuprolog.core.Atom, any Number to it.unibo.tuprolog.core.Integer or it.unibo.tuprolog.core.Real, single Chars to one-letter atoms, Boolean to it.unibo.tuprolog.core.Truth, and everything else to an ObjectRef wrapping the value as-is.

See also

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun convert(source: Any?): Term

Converts source into its Term representation.