New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#57: cage recursion #59
base: master
Are you sure you want to change the base?
#57: cage recursion #59
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maxonfjvipon WDYT
FALSE | ||
cge > @ | ||
|
||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maxonfjvipon this is more illustrating example, not working code,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@levBagryansky why doesn't it work? Everything seems fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maxonfjvipon I get an error EOcorrect_cage_recursionTest.works:124->PhDefault.attr:250->PhDefault.attr:248->PhDefault.attr:250 » Ex D="Error at "EOorg.EOeolang.EObytes$EOas_bool#φ" attribute; caused by Can't #copy() package object 'bytes'" here and don't know why
@levBagryansky reading... |
FALSE | ||
cge > @ | ||
|
||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@levBagryansky why doesn't it work? Everything seems fine
return this.attr("enclosure").get(); | ||
} | ||
``` | ||
That is, when dataizing, `cage` simply returned its `enclosure`. In order to trace how many times |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@levBagryansky I think we should explain what is enclosure
here because readers may not know the internal structure of the cage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maxonfjvipon done
``` | ||
`PhTracedEnclosure` keeps `enclosure` and `cage` that it traces. It also has something like **static** | ||
`Map<Phi, Integer>`, where it counts how many times `enclosure` was used: It increments `cage`'s | ||
counter before calling `enclosure::attr` method and decrement after. Thus, in the case of recursion, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@levBagryansky I would replaced "calling enclosure::attr
" with something more neutral, because it looks like very deep details of our implementation. I think here we should describe the main concept how we resolved the recursion, but not go deep into java implementation details
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maxonfjvipon Reduced the amount of java, but the basic principle is still described in terms of java, like Map adndstatic
. I seems to me such approach does not go to implementation too deeply.
@maxonfjvipon Maybe there are problems with rho in this snippet?
|
@maxonfjvipon I think we should either release it as how it worked before, or delay its release until we can fix it in a future version. |
Closes #57
PR-Codex overview
The focus of this PR is to address recursion issues in the
cage
object by implementing a mechanism to detect and handle deep recursion.Detailed summary
cage
EOcage::lambda
method to detect and handle recursionPhTracedEnclosure
to track and handle recursion incage
dataization