Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
29
Task/Null-object/M2000-Interpreter/null-object-3.m2000
Normal file
29
Task/Null-object/M2000-Interpreter/null-object-3.m2000
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
class something {
|
||||
}
|
||||
class alfa as something {
|
||||
x=10, y=20
|
||||
}
|
||||
a->alfa()
|
||||
Print a is type alfa = true
|
||||
Print a is type something = true
|
||||
a->0&
|
||||
Print a is type null = true
|
||||
\\ beta is a named object, is static
|
||||
group beta {
|
||||
type: something, alfa
|
||||
x=10, y=20
|
||||
}
|
||||
Print beta is type alfa = true
|
||||
Print beta is type something = true
|
||||
\\ now a is a pointer as a weak reference to beta
|
||||
a->beta
|
||||
print a is type alfa = true
|
||||
print a is type something = true
|
||||
a=pointer() ' same as a->0&
|
||||
Print a is type null = true
|
||||
\\ now a is a pointer of a copy of beta
|
||||
a->(beta)
|
||||
print a is type alfa = true
|
||||
print a is type something = true
|
||||
a=pointer() ' same as a->0&
|
||||
Print a is type null = true
|
||||
Loading…
Add table
Add a link
Reference in a new issue