Changeset 4590 for trunk/examples

Show
Ignore:
Timestamp:
11/13/08 07:50:36 (8 weeks ago)
Author:
pmoura
Message:

Corrected some typos in the "classmethods" and "people" examples.

Location:
trunk/examples
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/examples/classmethods/NOTES.txt

    r4572 r4590  
    1313 
    1414This example illustrates how to define "class methods" as found on class- 
    15 based object-oriented programming such as Java or Objective-C. Logtalk  
    16 classes are objects. Therefore, class methods are simply instance methods  
    17 defined in the class of the class, i.e. in its meta-class. 
     15based object-oriented programming languages such as Java or Objective-C. 
     16Logtalk classes are objects. Therefore, class methods are simply instance 
     17methods defined in the class of the class, i.e. in its meta-class. 
    1818 
    1919This example defines the following objects: 
  • trunk/examples/people/people.lgt

    r4501 r4590  
    3434        self(Self), 
    3535        create_object(Person, [extends(Self)], [], []), 
    36         Person::name(Name), 
    37         Person::birth(Birth). 
     36        Person::assertz(name(Name)), 
     37        Person::assertz(birth(Birth)). 
    3838    */ 
    3939 
     
    7272 
    7373    new(Person, Name, Birth, Office) :- 
    74         ::new(Person, Name, Birth), 
    75         Person::assertz(office(Office)). 
     74        ::new(Person, Name, Birth),         % create a "generic" person and 
     75        Person::assertz(office(Office)).    % add "teacher" specific data 
    7676 
    7777    print :- 
     
    104104 
    105105    new(Person, Name, Birth, Dorm) :- 
    106         ::new(Person, Name, Birth), 
    107         Person::assertz(dorm(Dorm)). 
     106        ::new(Person, Name, Birth),         % create a "generic" person and 
     107        Person::assertz(dorm(Dorm)).        % add "student" specific data 
    108108 
    109109    print :-