Skip to content

Fix configure_impl function #177

Open
@anutosh491

Description

@anutosh491

The configure_impl function is defined as this

void interpreter::configure_impl()
{
xeus::register_interpreter(this);
}

But xeus doesn't offer a register_interpreter function (it is just a forward declaration used for an internal usecase is what I can see)
https://github.com/jupyter-xeus/xeus/blob/f2084de96255631c77c1fc5a0bc698017f79549e/include/xeus/xinterpreter.hpp#L27

Also this call is required for having xwidgets working, so not sure if this should be done directly or via a string that the interpreter processes (something like what is done in xeus-cling)

    void interpreter::configure_impl()
    {
        // Process #include "xeus/xinterpreter.hpp" in a separate block.
        m_interpreter.process("#include \"xeus/xinterpreter.hpp\"", nullptr, nullptr, true);
        // Expose interpreter instance to cling
        std::string block = "xeus::register_interpreter(static_cast<xeus::xinterpreter*>((void*)"
                            + std::to_string(intptr_t(this)) + "));";
        m_interpreter.process(block.c_str(), nullptr, nullptr, true);
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions