13 lines
532 B
Plaintext
13 lines
532 B
Plaintext
in Org:RosettaCode
|
|
type MyClass ^|we are defining a new data type and entering in its static context|^
|
|
fun method ← void by block do writeLine("static method called") end
|
|
model ^|we enter the instance context|^
|
|
fun method ← void by block do writeLine("instance method called") end
|
|
end
|
|
type CallAnObjectMethod
|
|
var myInstance ← MyClass() ^|creating an instance|^
|
|
myInstance.method()
|
|
myInstance["method"]() ^|using symbolic references|^
|
|
MyClass.method()
|
|
var("Org:RosettaCode:MyClass", "method")() ^|using symbolic references|^
|