Universal smart cast in OOLib
Although 2p-kt claims to support smart cast between Prolog entities and (kotlin) objects behind-the-scenes, currently this only occurs within a method call -- not when the Prolog entity is the target of the method call. For instance, the following calls fail because the target is a number and therefore "not callable":
The only way to perform such calls currently is to perform a manual pre-conversion, namely:
X := (12 as $int), Y := X.toString
Is would be nice to support smart casts in a general way also on method call targets.