|
Revision 4662, 0.9 KB
(checked in by pmoura, 6 days ago)
|
|
Updated copyright notice.
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 | ================================================================ |
|---|
| 2 | Logtalk - Open source object-oriented logic programming language |
|---|
| 3 | Release 2.35.0 |
|---|
| 4 | |
|---|
| 5 | Copyright (c) 1998-2009 Paulo Moura. All Rights Reserved. |
|---|
| 6 | Logtalk is free software. You can redistribute it and/or modify |
|---|
| 7 | it under the terms of the "Artistic License 2.0" as published by |
|---|
| 8 | The Perl Foundation. Consult the "LICENSE.txt" file for details. |
|---|
| 9 | ================================================================ |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | % start by loading the example: |
|---|
| 13 | |
|---|
| 14 | | ?- logtalk_load(classvars(loader)). |
|---|
| 15 | ... |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | % get the value of the class variable for each instance: |
|---|
| 19 | |
|---|
| 20 | | ?- instance1::cv(Value1), instance2::cv(Value2), instance3::cv(Value3). |
|---|
| 21 | |
|---|
| 22 | Value1 = 0 |
|---|
| 23 | Value2 = 0 |
|---|
| 24 | Value3 = 0 |
|---|
| 25 | yes |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | % change the value of the class variable via instance1: |
|---|
| 29 | |
|---|
| 30 | | ?- instance1::set_cv(1). |
|---|
| 31 | |
|---|
| 32 | yes |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | % get the value of the class variable for the other instances: |
|---|
| 36 | |
|---|
| 37 | | ?- instance2::cv(Value2), instance3::cv(Value3). |
|---|
| 38 | |
|---|
| 39 | Value2 = 1 |
|---|
| 40 | Value3 = 1 |
|---|
| 41 | yes |
|---|