| Did you know ... | Search Documentation: |
| Term -> Object |
Transforming a Prolog term to a PCE object
Some of the interface predicates create PCE
objects from Prolog terms. This creation can be done in two modes:
either by implicit transformation if an argument is required (mode arg)
or explicit transformation if an object reference is to be produced
(mode new).
Normally, Prolog primitive data types are transformed into
corresponding PCE data types. Complex terms are transformed into
instances. For this transformation, the functor determines the classname
and the arguments serve as arguments to the ->initialise
method of the class.
Below is the table of transformations as performed by new/2,
send/[2-12] and get/[3-13]. New/2 does the outermost argument in new
mode. All other arguments are processed in arg mode.
Mode Prolog Data Pce Object ======================================================= - integer integer - real number Real object new atom Instance of the class (no arguments) arg atom name - Class(...Arguments...) Instance of Class from arguments - new(Data) Transform in `new` mode. - new(?Ref, Data) Transform in `new` mode, unify _Ref_
Parent: Prolog Interface