swirldev/swirl — pull request #175 by ncarchedi (2014-07-13 00:22:12+00:00)
Title: Avoid double printing in safeEval()

When `AUTO_DETECT_NEWVAR` is `TRUE`, which is the default setting, `safeEval()` causes double printing of the output from commands with side effects. Example below, before and after this pull request was implemented.

I don't think there's any danger to using `capture.output()` where I've put it in `safeEval()`, but a reality check is usually in order.

BEFORE:
```
| In its simplest form, R can be used as an interactive calculator.
| Type 5 + 7 and press Enter.

> str(list(a=3, b=5))
List of 2
$ a: num 3
$ b: num 5
List of 2
$ a: num 3
$ b: num 5

| You're close...I can feel it! Try it again. Or, type info() for more
| options.
```

AFTER:

```
| In its simplest form, R can be used as an interactive calculator.
| Type 5 + 7 and press Enter.

> str(list(a=3, b=5))
List of 2
$ a: num 3
$ b: num 5

| Not quite right, but keep trying. Or, type info() for more options.
```