Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Printing of Expr(:thunk) #18182

Closed
yuyichao opened this issue Aug 22, 2016 · 2 comments
Closed

Printing of Expr(:thunk) #18182

yuyichao opened this issue Aug 22, 2016 · 2 comments
Labels
display and printing Aesthetics and correctness of printed representations of objects.

Comments

@yuyichao
Copy link
Contributor

Right now the printing of Expr(:thunk) is basically useless

julia> expand(:(for i in a end))
:($(Expr(:thunk, Toplevel LambdaInfo thunk)))
@vtjnash
Copy link
Member

vtjnash commented Aug 22, 2016

I think we should always print the full expansion of the AST instead of Toplevel LambdaInfo thunk

@JeffBezanson JeffBezanson added the display and printing Aesthetics and correctness of printed representations of objects. label Jan 3, 2017
@ihnorton
Copy link
Member

Seems fixed (#18413 and related)

julia> expand(Main, :(for i in a end))
:($(Expr(:thunk, CodeInfo(:(begin
        SSAValue(0) = a
        #temp# = (Base.start)(SSAValue(0))
        3:
        unless !((Base.done)(SSAValue(0), #temp#)) goto 13
        SSAValue(1) = (Base.next)(SSAValue(0), #temp#)
        i = (Core.getfield)(SSAValue(1), 1)
        #temp# = (Core.getfield)(SSAValue(1), 2)
        # meta: location REPL[2]
        #= REPL[2]:1 =#
        # meta: pop location
        11:
        goto 3
        13:
        return
    end)))))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
display and printing Aesthetics and correctness of printed representations of objects.
Projects
None yet
Development

No branches or pull requests

4 participants