Show
Ignore:
Timestamp:
10/15/08 17:36:18 (3 months ago)
Author:
pmoura
Message:

Improved the documentation of the "complements" and "hooks" examples.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/examples/complements/complements.lgt

    r4274 r4508  
    11 
     2% setup the object employee as a monitor for any message sent to itself: 
    23:- initialization(define_events(before, employee, _, _, employee)). 
    34 
     
    1516 
    1617:- category(logging, 
    17     implements(monitoring), 
    18     complements(employee)). 
     18    implements(monitoring),     % built-in protocol for event handler methods 
     19    complements(employee)).     % add the category predicates to the employee object 
    1920 
     21    % define a "before" event handler for the complemented object: 
    2022    before(_, Message, Sender) :- 
    2123        write('Received message '), writeq(Message), write(' from '), writeq(Sender), nl. 
    2224 
    23     % add a new method to the object: 
    24  
     25    % add a new method to the complemented object: 
    2526    :- public(predicates/1). 
    2627