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
What if decorated functions f and g need to call each other? A problem arises if f is defined, g still isn't, yet f calls (directly or not) g. And they cannot be reordered because g calls f too and the problem would be the same with roles reversed. Without decorators there's hoisting, so no problem.
It seems that a sufficient solution, and possibly a piece of advice to include in educational materials, is for authors to define sets of (2, as above, or even more) mutually recursive decorated functions without any code that runs between their definitions which could call one already defined, inside of which a call to some still undefined "function" would be executed.
WDYT? It seems not to have been discussed at the February meeting, so I'm bringing it to your attention.
The text was updated successfully, but these errors were encountered:
What if decorated functions
f
andg
need to call each other? A problem arises iff
is defined,g
still isn't, yetf
calls (directly or not)g
. And they cannot be reordered becauseg
callsf
too and the problem would be the same with roles reversed. Without decorators there's hoisting, so no problem.It seems that a sufficient solution, and possibly a piece of advice to include in educational materials, is for authors to define sets of (2, as above, or even more) mutually recursive decorated functions without any code that runs between their definitions which could call one already defined, inside of which a call to some still undefined "function" would be executed.
WDYT? It seems not to have been discussed at the February meeting, so I'm bringing it to your attention.
The text was updated successfully, but these errors were encountered: