Passing functions to functions.
Is there a way to pass a function (pointer) as in input argument to a function in mojo?
3 Replies
Yep, there is an example here: https://github.com/modularml/mojo/blob/main/examples%2Fmatmul.mojo#L218-L220
GitHub
mojo/examples/matmul.mojo at main · modularml/mojo
The Mojo Programming Language. Contribute to modularml/mojo development by creating an account on GitHub.
I think you can pass the function either as a parameter or as an argument
Thank you!