Posted 22 November 2016 - 03:53 AM
In my program TypeCC, I ended up using some recursive function calls. E.g., splitBlocks -> processBlockquote -> splitBlocks. When I initially tried this, I got an "attempt to call nil" error in the processBlockquote function. I fixed this by declaring "local splitBlocks" near the top of the file.
Why is this happening? I would understand if I was trying to call the function before it was defined, but not only is it not being called until after all function definition is taken place, it is being called from a function that it itself called…
Is this some weird voodoo with the local keyword, or something else?
Why is this happening? I would understand if I was trying to call the function before it was defined, but not only is it not being called until after all function definition is taken place, it is being called from a function that it itself called…
Is this some weird voodoo with the local keyword, or something else?