new tasks
This commit is contained in:
parent
2a4d27cea0
commit
80737d5a6a
1194 changed files with 15353 additions and 1 deletions
1
Task/Classes/Forth/classes-2.fth
Normal file
1
Task/Classes/Forth/classes-2.fth
Normal file
|
|
@ -0,0 +1 @@
|
|||
MyClass newInstance
|
||||
1
Task/Classes/Forth/classes-3.fth
Normal file
1
Task/Classes/Forth/classes-3.fth
Normal file
|
|
@ -0,0 +1 @@
|
|||
New> MyClass value newInstance
|
||||
2
Task/Classes/Forth/classes-4.fth
Normal file
2
Task/Classes/Forth/classes-4.fth
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
10 set: newInstance
|
||||
show: newInstance
|
||||
2
Task/Classes/Forth/classes-5.fth
Normal file
2
Task/Classes/Forth/classes-5.fth
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
newInstance dispose
|
||||
0 to newInstance \ no dangling pointers!
|
||||
5
Task/Classes/Forth/classes-6.fth
Normal file
5
Task/Classes/Forth/classes-6.fth
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
: test { \ obj -- }
|
||||
New> MyClass to obj
|
||||
show: obj
|
||||
1000 set: obj
|
||||
obj dispose ;
|
||||
14
Task/Classes/Forth/classes.fth
Normal file
14
Task/Classes/Forth/classes.fth
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
:class MyClass <super Object
|
||||
|
||||
int memvar
|
||||
|
||||
:m ClassInit: ( -- )
|
||||
ClassInit: super
|
||||
1 to memvar ;m
|
||||
|
||||
:m ~: ( -- ) ." Final " show: [ Self ] ;m
|
||||
|
||||
:m set: ( n -- ) to memvar ;m
|
||||
:m show: ( -- ) ." Memvar = " memvar . ;m
|
||||
|
||||
;class
|
||||
Loading…
Add table
Add a link
Reference in a new issue