capture_expr_output function

Capture side effects issued by an evaluated expression