Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
4
Task/Classes/Pop11/classes-1.pop11
Normal file
4
Task/Classes/Pop11/classes-1.pop11
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
uses objectclass;
|
||||
define :class MyClass;
|
||||
slot value = 1;
|
||||
enddefine;
|
||||
13
Task/Classes/Pop11/classes-2.pop11
Normal file
13
Task/Classes/Pop11/classes-2.pop11
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
;;; Construct instance with default slot values
|
||||
lvars instance1 = newMyClass();
|
||||
;;; Construct instance with explicitely given slot values
|
||||
lvars instance2 = consMyClass(15);
|
||||
;;; Print slot value using dot notation
|
||||
instance1.value =>
|
||||
instance2.value =>
|
||||
;;; Print slot value using funtional notation
|
||||
value(instance1) =>
|
||||
;;; Change slot value
|
||||
12 -> value(instance1);
|
||||
;;; Print it
|
||||
value(instance1) =>
|
||||
6
Task/Classes/Pop11/classes-3.pop11
Normal file
6
Task/Classes/Pop11/classes-3.pop11
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
define :method reset(x : MyClass);
|
||||
0 -> value(x);
|
||||
enddefine;
|
||||
reset(instance1);
|
||||
;;; Print it
|
||||
instance1 =>
|
||||
Loading…
Add table
Add a link
Reference in a new issue