Skip to content
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

process with disableValuePrinting set to true #184

Open
gouarin opened this issue May 22, 2018 · 2 comments
Open

process with disableValuePrinting set to true #184

gouarin opened this issue May 22, 2018 · 2 comments

Comments

@gouarin
Copy link
Contributor

gouarin commented May 22, 2018

In https://github.com/QuantStack/xeus-cling, we changed a little bit the way to process the input given in a cell notebook in order to write the output cleanly.
To do that, we use the flag disableValuePrinting in the process method of the MetaProcessor and we found a bug.

Here is a simple example which illustrates the issue in the cling interpreter

#include <iostream>
#include "cling/Interpreter/Value.h"
#include "cling/Utils/Output.h"
#include "cling/MetaProcessor/MetaProcessor.h"

cling::MetaProcessor processor(*gCling, cling::errs());
cling::Value output;
cling::Interpreter::CompilationResult compilation_result;

std::string myinput{R"(auto test = [](auto i){std::cout << i << "\n";};)"};

processor.process(myinput, compilation_result, &output, true);
test(5)

The error message is

input_line_13:2:2: error: type '(lambda at input_line_12:2:14)' does not provide a call operator
 test(5)

Note that if you add a semicolon at the end of the myinput string, the problem is solved.

std::string myinput{R"(auto test = [](auto i){std::cout << i << "\n";};;)"};

It's a critical issue for xeus-cling and we hope that you can fix it soon in order to add a patch in your build process.

@SylvainCorlay
Copy link
Contributor

Subscribing!

@vgvassilev
Copy link
Owner

I will take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants