[top] [up] [next]

Operators and predicates for OO extensions


The OO extensions are implemented in the interpreter for maximum performance but several operators were added to make it possible to define classes and send messages to instances. In the table below the definition of all these operators is displayed.

Priority Specifier Operators
1100 fx class, abstractclass, declareclass, endclass, inherit, parts, singletonclass
900 xfx new_obj/2, new_obja/2
900 fx del_obj/1
200 xfx <-/2, ::, obj_name/2, ::<-/2, unique_name/2
200 fx ::<-/1

There are several built-in predicates related to the OO extensions. The following table states all of these.  

Predicate
instance/1 Determine if the arguments refer to an instance of a class.
get_instance/2 Get the class instance if a meta-variable has been unified with a class instance.
class_name/2 Determine the class name of an instance.
this/1 Retrieve the instance for which a method of a class is being executed.

[top] [up] [next]

 

info@trinc-prolog.com