RosettaCodeData/Task/Reflection-List-methods/Lingo/reflection-list-methods-2.lingo
2023-07-01 13:44:08 -04:00

11 lines
260 B
Text

obj = script("MyClass").new()
put obj.handlers()
-- [#foo, #bar]
-- The returned list contains the object's methods ("handlers") as "symbols".
-- Those can be used like this to call the corresponding method:
call(#foo, obj)
-- "foo"
call(#bar, obj)
-- "bar"