-
First of all, Thank you so much for this amazing numbat!!! I'm walking through the source but still need some time to understand how the VM works. Is there a way to clear user defined functions, vars like |
Beta Was this translation helpful? Give feedback.
Answered by
sharkdp
Oct 23, 2024
Replies: 1 comment 2 replies
-
I'm not sure I understand. Are you using Numbat as a library? Or as a CLI/Web tool? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm afraid this is not possible at the moment. What we do in the web-version is to replace the whole interpreter (
numbat/numbat-wasm/www/index.js
Line 45 in 80b3f34
You could cache/store the context after the prelude has been loaded, but before any user input has been evaluated. Whenever you want to reset, you go back to that cached state of the context. We do something similar in the unit tests, and it was a massive speed up for the test suite.