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

REPL: call display on the backend #57773

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

IanButterworth
Copy link
Member

Fixes #57742

With this PR (The last 2 are pasted in in one operation)

% ./julia -q -t8,0

julia> struct Foo end

julia> Base.display(::Foo) = @show Threads.threadid()

julia> Foo()
Threads.threadid() = 1

julia> Foo()
Threads.threadid() = 1

julia> Foo()
Threads.threadid() = 1

julia> Foo()
Threads.threadid() = 1

@IanButterworth IanButterworth added REPL Julia's REPL (Read Eval Print Loop) backport 1.11 Change should be backported to release-1.11 backport 1.12 Change should be backported to release-1.12 labels Mar 14, 2025
@IanButterworth
Copy link
Member Author

Though I think handling errors in display might need a tweak.

julia> Base.display(::Foo) = error()

julia> Foo()

julia> Foo()

julia>

@IanButterworth IanButterworth requested a review from vtjnash March 14, 2025 14:18
@giordano giordano linked an issue Mar 14, 2025 that may be closed by this pull request
Copy link
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Branching on whether the parser returned an Expr or a Function seems somewhat unwise, but otherwise the PR seems a good direction

@IanButterworth IanButterworth force-pushed the ib/repl_display_backend branch from ff842d8 to f8c5f14 Compare March 15, 2025 02:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.11 Change should be backported to release-1.11 backport 1.12 Change should be backported to release-1.12 REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants