Hi, all. For my project I'd like to create a hierarchical structure of custom scopes, in each of which certain variables are defined, and inside each of which I can execute new code at any time. I would like to be able to create and modify these scopes using the external API. I haven't been able to figure out a way to get this to work, so I decided to post a question here - is this possible? And if not, is there some way to get something similar to work?
Basically, my ideal scenario would be something like this:
I understand that this isn't really how the interpreter is set up, and I also thought about perhaps creating a new interpreter instance for each "scope" that I'm thinking of and inheriting variables manually, but because I'm pretty inexperienced using this library, I'm kind of stuck.
Basically, I would like to know if there is an intended way to do something similar to this, and if not, maybe some pointers as to how I could get it to work.
Ok, so I basically ended up building my own system where every "scope" has his own Interpreter instance, and I transfer variables between them manually, as I already said.
Hi, all. For my project I'd like to create a hierarchical structure of custom scopes, in each of which certain variables are defined, and inside each of which I can execute new code at any time. I would like to be able to create and modify these scopes using the external API. I haven't been able to figure out a way to get this to work, so I decided to post a question here - is this possible? And if not, is there some way to get something similar to work?
Basically, my ideal scenario would be something like this:
I understand that this isn't really how the interpreter is set up, and I also thought about perhaps creating a new interpreter instance for each "scope" that I'm thinking of and inheriting variables manually, but because I'm pretty inexperienced using this library, I'm kind of stuck.
Basically, I would like to know if there is an intended way to do something similar to this, and if not, maybe some pointers as to how I could get it to work.
Thanks in advance!