Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@SimeonEhrig
Created October 14, 2019 11:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SimeonEhrig/308e10aa0acc09f2a37299a0ce58b07c to your computer and use it in GitHub Desktop.
Save SimeonEhrig/308e10aa0acc09f2a37299a0ce58b07c to your computer and use it in GitHub Desktop.
Cling Redefinition

How to enable

[cling]$ #include "cling/Interpreter/Interpreter.h"
[cling]$ gCling->allowRedefinition();
[cling]$ gCling->isRedefinitionAllowed();

About

root-project/root#4214 root-project/cling#259

Access hidden variables

When you redefine a variable, class, or anything else, you are actually overlay the variable, class, etc. This allows you to access the previous definition. The definition uses namespaces to hide variables. It starts with __cling_N50 and continues with __cling_N51 and so on. Right now, I don't know how to determine the namespace of a variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment