guild icon
Toit
#Question about the language construct
Thread channel in help
MichaelK
MichaelK 01/07/2025 09:03 AM
Is it possible in toit to describe several similar functions, place references to them in a list, and then call these functions one after another in a loop (through the list, naturally)?
floitsch
floitsch 01/07/2025 09:22 AM
I replied in the GitHub discussion, but for reference:
You can use lambdas.
main: lambdas := [ :: print "hello", :: print "world", ] lambdas.do: | fun/Lambda | fun.call
2 messages in total