clarification

This commit is contained in:
Peter Fidelman 2022-05-22 10:53:45 -07:00
parent 8dee9a9bbc
commit 093e583131

View file

@ -64,8 +64,8 @@ The rdrop word is the "subroutine to drop the return address".
Here is why it works.
Start of tail-recursive subroutine: Return-stack: { caller }
After calling A: Return-stack: { caller caller }
After calling B: Return-stack: { caller }
At the end of line A: Return-stack: { caller caller }
At the end of line B: Return-stack: { caller }
In other words, the back-to-back calls to A and B cancel each other out.
@ -73,8 +73,8 @@ In the body of the loop: Return-stack: { caller }
Meaning you can break out of the loop with RET.
At subroutine call to B: Return-stack: { caller C }
After calling B: Return-stack: { caller }
At subroutine call to line B: Return-stack: { caller C }
At the end of line B: Return-stack: { caller }
And now we are at the top of the loop again.