-
Notifications
You must be signed in to change notification settings - Fork 3
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
Keep timestamps off the stack #41
Comments
I want to clarify this is not regular code; the whole idea behind However, I will give this some thought and will come back to this. I first want to get 0.99 working. |
It may not be a regular example, however the Even without If code isolation is what you intended, I can fairly easily add a stack-effect check to my existing PR, to ensure that all |
Considering that this is an entirely non-breaking change, I had hoped to get the PR merged before the 0.99 update as it will likely be more involved by then. |
There's no rush, I've made new releases of the test framework before. If I would make this change, I'd rather combine it with some other issues I would like to solve. |
Well that would be why I would suggest to get it resolved before the 0.99 release, since that release is inevitable anyway. So perhaps can you explain your hesitance?
Yes I am aware, but recall that we first discussed this 5 months ago when you directed me to post it on Github discussions for further discussion and consideration, but when that didnt happen I thought I may as well contribute the fix myself, considering how often I use the vocab :) |
Sorry, missed that you posted it as a discussion in here. My hesitance is related to what I stated; it's not in line with the original design, which is also used by the Forth test framework. I think you're probably the only one wanting to use the test framework like this, and I've noticed you're using the test framework in unexpected ways. Before going there I want to make sure things keep working like they were intended. |
I still don't see how it isn't inline with the original design, the it and describe blocks are still run the same as before, the only change is that the timestamp value is moved to the retain stack instead of the call stack. Currently we have something like (simplified)
I think you are misunderstanding me. This is not a feature request so that I can use the framework in weird ways, this is a bug report and fix due to strange behaviour, both for solvers and authors. I had noticed it as a solver before but ignored it, but it was actually gifti who brought it up as a bug they had encountered while authoring, it was just me who felt motivated to solve it. |
(I am not sure why this this wasn't raised as an issue, and have just remembered it now, so moving it to a more appropriate place).
Currently, both
it#{
anddescribe#{
leave a timestamp on the stack, used for reporting the runtime of the users code. This is essentially an implementation detail, but the issue is that it can interfere with user code. Consider this:This seems fairly regular code, however without the author realising it, it will be calling both
run-test
words with some arbitrary number, instead of the expected data structure!There is really no reason for the timestamps to be left on the stack like this, and it is simple to fix. Simply scan the relevant block, and run the resulting quotation inside
dip
such that the timestamp is moved to the retain stack. See this for a simple proof of concept.The text was updated successfully, but these errors were encountered: