title: Why is Tcl_Interprer implemented in such a way?
body: <pre><code>int main() {
      Tcl_Interp *interp = Tcl_CreateInterp(); 
  
      Tcl_Eval(interp, "close stdout");
      Tcl_Eval(interp, "puts hello");
  
      std::cout &lt;&lt; "other output" &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>I have a program which uses <code>Tcl_Interpreter</code>. I don't want to see its output in stdout, so I am closing it. But it closes stdout of whole program and <code>"other output"</code> is not displayed too. My program could have lots of other outputs. Why Tcl interpreter disables it. </p>
  
  <p>This kind of situation is when I am trying to evaluate <code>exit</code> command in interpreter. I expect that it should only destroy, delete or disable the interpreter, but it is calling <code>std::exit</code> which closes whole program, which retains undestructed objects. </p>
  
  <p>I know that there may be workarounds to this situations but I am curios why does Tcl Interpreter implemented in such way. It would be more useful that it changes only itself, not the whole program. </p>