dotnet-script icon indicating copy to clipboard operation
dotnet-script copied to clipboard

Suggestion: provide an `eval` option for implicit expression output, as in the REPL

Open mklement0 opened this issue 6 years ago • 0 comments

The implicit output of expression results in the REPL is a great feature that obviates the need for Console.WriteLine() (and even does a better job at creating meaningful output than straight .ToString() stringification).

Especially for presumably typically short code passed to dotnet-script eval, it would be handy to have automatic result printing as well, so that instead of:

dotnet-script eval "Console.WriteLine(1+2)"

you could simply write something like:

dotnet-script eval "1+2"  -p

and have 3 automatically printed.

mklement0 avatar Nov 07 '19 16:11 mklement0