---
title: "Comment by Matthijs Cox on \"User-defined Show Method in Julia\" | Hashnode"
description: "Found another summary of all show/print options, which will be added to the Julia docs: https://discourse.julialang.org/t/how-to-display-a-sparse-array-on-the-r"
url: "https://hashnode.com/posts/user-defined-show-method-in-julia/64b6927d72b48291dcb16270/comment/66b480f3bca0913121b26784"
---

[Discussion](https://hashnode.com/posts/user-defined-show-method-in-julia/64b6927d72b48291dcb16270)

Comment [User-defined Show Method in Julia](https://hashnode.com/posts/user-defined-show-method-in-julia/64b6927d72b48291dcb16270)

[Matthijs Cox](https://hashnode.com/@matthijscox)

[Aug 8, 2024](https://hashnode.com/posts/user-defined-show-method-in-julia/64b6927d72b48291dcb16270/comment/66b480f3bca0913121b26784)

Found another summary of all show/print options, which will be added to the Julia docs: [discourse.julialang.org/t/how-to-display-a-sparse…](https://discourse.julialang.org/t/how-to-display-a-sparse-array-on-the-repl/113565/5)

And this discussion: [discourse.julialang.org/t/print-vs-two-argument-s…](https://discourse.julialang.org/t/print-vs-two-argument-show-repr-vs-three-argument-show-repr-with-mime-text-plain/117790)

[Matthijs Cox](https://hashnode.com/@matthijscox)

[Aug 12, 2024](https://hashnode.com/posts/user-defined-show-method-in-julia/64b6927d72b48291dcb16270/comment/66b480f3bca0913121b26784#reply-66b9da89031820634b573395)

After reading these discussions, I may have interpreted `:compact` in the wrong way, it's not intended for switching between single-line and multi-line displaying.

Also the philosophy of the 2-argument `show(io::IO, t::MyType)` is that it always returns an expression that can be evaluated, kinda like the constructor. You do not want compact mode to accidentally switch it to a multi-line printing.
