________________________________________________________________________

This file is part of Logtalk <http://logtalk.org/>  

Logtalk is free software. You can redistribute it and/or modify it under
the terms of the FSF GNU General Public License 3  (plus some additional
terms per section 7).        Consult the `LICENSE.txt` file for details.
________________________________________________________________________


% start by loading the non-patched object "employee":

| ?- logtalk_load(complements_allow(employee)).
...


%  ask "employee" its name:

| ?- employee::name(Name).

Name = john
yes


% check the protocol of the object "employee":

| ?- findall(Predicate, employee::current_predicate(Predicate), Predicates).

Predicates = [age/1, name/1, salary/1]
yes


% now load the "add_on" complementing category:

| ?- logtalk_load(complements_allow(add_on)).
...


% find categories that complement objects:

| ?- complements_object(Category, Object).
Category = add_on,
Object = employee.
yes 


% use the event handler defined in the "add_on" category for the object "employee":

| ?- employee::name(Name).
Received message name(_16) from user

Name = john
yes


% check the new protocol of the object "employee":

| ?- employee::predicates(Predicates).
Received message predicates(_G180) from user

Predicates = [after/3, age/1, before/3, income/1, name/1, predicates/1, salary/1]
yes

| ?- employee::predicate_property(predicates(_), Property).

Property = logtalk ;
Property = scope(public) ;
Property = (public) ;
Property = static ;
Property = declared_in(add_on) ;
Property = declared_in(add_on, 29) ;
Property = defined_in(add_on) ;
Property = defined_in(add_on, 31) ;
Property = number_of_clauses(1)
yes

| ?- employee::predicate_property(income(_), Property).

Property = logtalk ;
Property = scope(public) ;
Property = (public) ;
Property = static ;
Property = declared_in(employee) ;
Property = alias_of(salary(_G3724)) ;
Property = defined_in(employee) ;
Property = number_of_clauses(0)
yes
