I noticed that inside Compile there seems to be no way to define a function. It always call MainEvalute:
fun = Compile[{x, _Real}, Module[{y = x, f}, f[y_] = y^2; y + f[y]]]
Any way to overcome it?
Thanks.
I don't see how that answers the question.
The point is not just to use Module to get the answer, I need to make multiple function assignments inside Module and it should be compiled by function Compile to ensure a fast execution as it needs to be called hundreds thousands of times.
Module
Compile