RosettaCodeData/Task/Reflection-List-methods/Lingo/reflection-list-methods-2.lingo

12 lines
260 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
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"