JuliaLang/julia — pull request #1458 by toivoh (2012-10-27 12:00:43+00:00)
Title: Minor cosmetic improvements for showing of AST:s

Fixes:

* Show wrongly interpolated AST:s such as `:(x=$[1])` differently from correct AST:s such as `:(x=[1])`, so you can see that they are fishy.
* Get rid of some superfluous quoting in the fallback for exprs that we don't know how to show,
such as `expr(:foo, 1, :x)`.

Before:

julia> [:(x=$[1]), :(x=[1])]
2-element Expr Array:
:( x = [1] )
:( x = [1] )

julia> expr(:foo, 1, :x)
:( $(expr(:foo, :( 1 ), :x)) )

After:

julia> [:(x=$[1]), :(x=[1])]
2-element Expr :Array:
:( x = $([1]) )
:( x = [1] )

julia> expr(:foo, 1, :x)
:( $(expr(:foo, 1, :x)) )

I would like to reduce quoting in the last example further to show it as `expr(:foo, 1, :x)` instead, but I haven't figured out a good way to do that yet.