this(?Instance)

This built-in predicate determines the instance for which a method of a class is being executed. The variable is unified with that instance. The predicate fails if the 'Instance' variable already contains a different instance, else it is exited successfully.

Remark: in version R3A and before of Trinc-Prolog this predicate used to throw 'type_error(variable, Argument)' exceptions.

see also: add_callback/3 add_callback/4 callbacks class_name/2 clear_var/1 del_obj/1 get_instance/2 instance/1 new_obj/2 new_obja/2  ispresent_callback/4 object-oriented prolog remove_callback/4 <-/2 ::<-/1 ::<-/2

Exceptions  
The argument is not a variable  nor an instance of a class a type_error(instance, Argument) exception is thrown

 

 

info@trinc-prolog.com