42aabce1bb
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1973 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
26 lines
1.1 KiB
Plaintext
26 lines
1.1 KiB
Plaintext
================================================================
|
|
Logtalk - Open source object-oriented logic programming language
|
|
Release 2.30.7
|
|
|
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
|
================================================================
|
|
|
|
|
|
To load this example and for sample queries, please see the SCRIPT file.
|
|
|
|
Example adopted from the chapter "Classifying Prototype-Based Programming
|
|
Languages" by Christophe Dony, Jacques Malenfant, and Daniel Bardou, found
|
|
on the book "Prototype-Based Programming - Concepts, Languages, and
|
|
Applications" published by Springer.
|
|
|
|
|
|
This prototype programming example illustrates how we can do both property
|
|
sharing and value sharing in Logtalk by calling the built-in predicate
|
|
modification methods asserta/1, assertz/1, and retract/1 either in the
|
|
context of "this" or in the context of "self".
|
|
|
|
In this example we have a prototype, joePerson, containing general data on
|
|
Joe such as its age, name, or address, and four descendant prototypes or
|
|
viewpoints, joeSportsman, joeEmployee, joeChessPlayer, and joeFilmEnthusiast.
|
|
Each descendant contains data related to a particular viewpoint about Joe.
|