https://toitlang.org/ logo
Question about the language construct
# help
m
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)?
f
I replied in the GitHub discussion, but for reference: You can use lambdas.
Copy code
main:
  lambdas := [
    :: print "hello",
    :: print "world",
  ]
  lambdas.do: | fun/Lambda |
     fun.call