inter.process("{")
inter.process(“int a,b,c;”);
inter.process(“a = 4345; b =929; c=-44556”);
inter.process("}")
Right now, the ony way I can think of doing this “correctly”: is to record all of my calls to a string (with the curly braces starting and ending the string) then running process() on it. My worry however, is that the string what execute correctly (in case execute() and declare() need to be called seperately on the file…)
We have just uploaded the support for multiple interpreters. You may want to give that a try - if you’re not time-critically spinning up new contexts. It should allow you to move the temporary contexts into a child interpreter, and discard that once done.
See the Interpreter constructor taking another Interpreter.
I’m going to give this a shot. Any word when this feature will be moved into release?
Also a question: does the child interpreter inherit the parent’s state?
In otherwords, if I have a number of headers loaded into the parent, will a new child know about its parent’s headers?
Well - this is cling, not ROOT, and we haven’t had a cling release for a while. Are you asking for a cling release?
And yes, that’s the whole point: the child interpreter can ask the parent interpreter as soon as it doesn’t know something. The parent interpreter remains frozen (also to the extent that we currently do not allow the parent to be modified during the lifetime of the child).
Let me know what we can do to make this more accessible to you!
I was asking about a ROOT release (especially since compiling and deployment of ROOT is just so much easier).
Im fine with the git snapshot, however for peace of mind prefer a release snapshot
(for clarification, just asking when the next release date is, not asking to expidite)
Thanks for clarifying about the child interpreter. At the moment, the only request I have about it, is just to document the constructor declaration about its behavior , especially since I wouldn’t have known that otherwise.
{
cling::Interpreter inter(2, clingArgs, PATH_TO_LLVM.c_str()); //inter.DumpIncludePath();
inter.declare("#include \n");
inter.process(“double d = 324.342;\n”);
inter.process(“std::cout << d << std::endl;\n”);
cling::Interpreter * inter2 = new cling::Interpreter(inter, 2,clingArgs,PATH_TO_LLVM.c_str());
inter2->process(“std::cout << d << std::endl”);
}[/code]
[quote]324.342
error: cannot import unsupported AST node SubstTemplateTypeParm
input_line_1:2:7: error: no member named ‘cout’ in namespace 'std’
std::cout << d << std::endl
input_line_1:2:25: error: no member named 'endl' in namespace 'std'
std::cout << d << std::endl
[/quote]
We are extending the ASTImporter with the clang people; SubstTemplateTypeParm is one of the missing ingredients. You are very welcome to help! Let me know so we can coordinate. (And apologies for the late reply; this slipped through…)
I would love to help! It would take me a bit of time to get more familiar with the cling codebase, so any guidaance on how to get started would be appreciated
Take a look here: github.com/karies/root/pull/162 and check whether it fixed your SubstTemplateTypeParm issue - and report taht, report the next issue, and then take the existing PRs as guidance on how to implement that