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

showcompact(::RefValue) prints the contained object compactly #12929

Closed
wants to merge 1 commit into from

Conversation

timholy
Copy link
Sponsor Member

@timholy timholy commented Sep 3, 2015

No description provided.

@@ -70,3 +70,10 @@ setindex!(b::RefValue, x) = (b.x = x; b)
setindex!(b::RefArray, x) = (b.x[b.i] = x; b)

###

function showcompact(io::IO, b::RefValue)
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

maybe just do b::Ref ?

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

Arrays already use showcompact for printing their elements, so I didn't think it was necessary. But I can change it if you think it's better that way.

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

To clarify, sometimes showcompact(::Array) is bigger than show(::Array) because showcompact seems to do a showall even though it skips the formatting.

@timholy
Copy link
Sponsor Member Author

timholy commented Jan 2, 2016

AFAICT, this seems unnecessary now with the IOContext overhaul. Thanks to @vtjnash.

@timholy timholy closed this Jan 2, 2016
@timholy timholy deleted the teh/showcompact_ref branch January 2, 2016 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants