Redefining functions/classes

Hi All,

Does cling allow dynamically redefining functions without rolling back the code that was defined after it? E.g.:

int func1() {return 1;}
int func2() {return func1() + 1;}

func2()
2

int func1() {return 2;}
func2()
3

Or is the only way to achieve this - undo all code up to the definition of func1(), redefine func1() and input func2() again?

Hi,
For now undo N, where N is the number of input lines, is the way to go. If you want to override this behavior you could by implementing an InterpreterCallbacks.
Cheers,
Vassil