Changeset 4526 for trunk/examples

Show
Ignore:
Timestamp:
10/21/08 09:08:54 (3 months ago)
Author:
pmoura
Message:

Allow a complementing category to define an alias for a predicate of the complemented object.

Location:
trunk/examples/complements
Files:
2 modified

Legend:

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

    r4522 r4526  
    3030        setof(Predicate, ::current_predicate(Predicate), Predicates).  
    3131 
     32    % define an alias for a predicate of the complemented object: 
     33    :- alias(employee, salary/1, income/1). 
     34 
    3235:- end_category. 
  • trunk/examples/complements/NOTES.txt

    r4507 r4526  
    1515explicitly complement an existing object (without modifying its source  
    1616code), thus providing functionality similar to Objective-C categories. 
     17 
     18The complemented objects need to be compiled with the flag "complements"  
     19switched on. This is a less than ideal solution that was adopted in order  
     20to both improve performance of code that doesn't use complementing categories  
     21and to provide a solution for preventing the use of complementing categories  
     22to break object encapsulation.