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

Handle undo for xeus-cpp/xeus-cpp-lite #263

Open
anutosh491 opened this issue Feb 28, 2025 · 1 comment
Open

Handle undo for xeus-cpp/xeus-cpp-lite #263

anutosh491 opened this issue Feb 28, 2025 · 1 comment
Labels
bug Something isn't working enhancement New feature or request

Comments

@anutosh491
Copy link
Collaborator

Clang-repl provides an undo option which I guess should help us get past redefinition issues .
https://llvm.org/devmtg/2022-11/slides/Lightning6-RecoveringFromErrorsInClang-ReplAndCodeUndo.pdf

For example

anutosh491@Anutoshs-MacBook-Air bin % ./clang-repl
clang-repl> extern "C" int printf(const char*, ...);
clang-repl> int x = 50;
clang-repl> %undo
clang-repl> const char* x = "Hello World";
clang-repl> auto r = printf("%s\n", x);
Hello World

Without the undo you would get

clang-repl> int y = 50;
clang-repl> const char* y = "Hello World";
In file included from <<< inputs >>>:1:
input_line_6:1:13: error: redefinition of 'y' with a different type: 'const char *' vs 'int'
    1 | const char* y = "Hello World";
      |             ^
input_line_5:1:5: note: previous definition is here
    1 | int y = 50;
      |     ^
error: Parsing failed.

When the same is attempted through xeus-cpp, it is being considered as a magic but probably should be looked at from a simple execute_request point of view .

Image

@github-actions github-actions bot added the Needs triage Used in auto labelling of new issues label Feb 28, 2025
@anutosh491
Copy link
Collaborator Author

anutosh491 commented Feb 28, 2025

So yeah two tasks here

  • fix undo for xeus-cpp
  • fix undo for xeus-cpp-lite. Probably this might be more involved all calls for implementing this I'g guess.

But yeah for starters, we just need to make sure these are not being considered as magics.

@anutosh491 anutosh491 added bug Something isn't working enhancement New feature or request and removed Needs triage Used in auto labelling of new issues labels Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant