Is there a modifier that can be put on a function declaration that will force it to not be a closure? I would like the following not to compile with this supposed modification to inner
:
let outer() =
let i = 7
let inner() =
printf "%i" i
inner()
but to complain about i
not defined. The reason for this is safety -- I want to make sure I'm not capturing and perhaps modyfing anything when I'm intending not to, and performance of closures versus functions.