RosettaCodeData/Task/Call-an-object-method/EMal/call-an-object-method.emal

10 lines
381 B
Plaintext

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()
MyClass.method()