To be very short:
- When you execute a macro including one single unnamed function
{
// some statements
}
this macro is executed in the interpreter global scope. After
the execution of this macro, all variables created in the macro
are
still accessible at the command line. This kind of macro should
in general starts with the statement
gROOT->Reset();
that will reset all CINT variables created since the login stage.
= When you execute a macro including one or more named functions
like:
void example()
{
// some statements
}
all variables created in example are automatically deleted
when returning from the function (normal C++ scoping rules).
The first flavour is typical of a short test macro (like a collection
of commands typed at the command line).
The second flavour is recommended for large macros.
Rene Brun