This operator can delete one or more instances of a class. If the right operand is a variable then it must refer to a specific instance of a class. If the right operand is an atom then all instances that match with the goal are deleted, i.e. it is possible to delete more than one instance.
see also: add_callback/3 add_callback/4 callbacks class_name/2 clear_var/1 get_instance/2 instance/1 new_obj/2 new_obja/2 ispresent_callback/4 object-oriented prolog remove_callback/4 <-/2 ::<-/1 ::<-/2 this/1
| Examples | |
| Instance new_obj menu, del_obj Instance |
the menu instance referred to by the variable 'Instance' is deleted |
| del_obj edit. | all instances that unify with the name 'edit' are deleted |
| Exceptions | |
| the variable is empty | an instantiation_error exception is thrown |
| the clause to delete is not a class instance. | an existence_error(class, A) exception is thrown and A is replaced by the incorrect operand |
| instance to delete was not created by new_obj/2 or new_obja/2 | a type_error(static_instance, A) is thrown, A is replaced by a reference to the static instance |
| the instance to delete is an attribute of another instance | a type_error(normal_class, A) exception is thrown, A is replaced by a reference to the attribute instance |
| right operand is not a variable nor an atom | a type_error(callable, A) exception is thrown and A is replaced with the incorrect operand |
| if the operand is an atom and there is no active module | an existence_error(active_module) exception is thrown |