Created
September 2, 2017 20:30
-
-
Save paniq/8dcb2231d4b1ab4857520e527fc747ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
when the entry label to a function is originally declared (during macro expansion), | |
the entry label is tagged with the label that was active when the label was declared; | |
this is called the scope label. | |
later, during evaluation, when an entry label is encountered as argument, and the | |
label has a scope label tag, the current frame (a cactus stack) is searched upwards | |
for the scope label, and truncated by that amount. | |
if the scope label tag can not be found in upwards frames (and this is the part that | |
gives me grief, because it happens too much) then the current frame is taken as-is. | |
the closure is then formed from the entry label and the frame. | |
so, in short: closure is formed from the active frame + label by default, but if we | |
can truncate the frame, we do. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment