You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently allow functions to call themselves without a forward declaration, but mutual recursion would still require at least some subset of the required functions to be declared. We can instead do a first pass through the function block which only adds each function's signature to the symbol table, and then our second pass as normal which checks the bodies etc. This would mean all functions are available to all other functions in an order-independent way.
After this change, function declarations are only really useful for defining functions in other (stan|c++) files. In the long term we may want to move toward this being the only valid use of them for simplicity.
The text was updated successfully, but these errors were encountered:
Relevant to @bob-carpenter 's comment here: stan-dev/docs#408 (comment).
We currently allow functions to call themselves without a forward declaration, but mutual recursion would still require at least some subset of the required functions to be declared. We can instead do a first pass through the function block which only adds each function's signature to the symbol table, and then our second pass as normal which checks the bodies etc. This would mean all functions are available to all other functions in an order-independent way.
After this change, function declarations are only really useful for defining functions in other (stan|c++) files. In the long term we may want to move toward this being the only valid use of them for simplicity.
The text was updated successfully, but these errors were encountered: