No, this is wrong. The 1-argument show(x) (which is also called by print(x) for most types) calls the 2-argument show(stdout, x). For matrices, this is less verbose than the 3-argument show(stdout, "text/plain", x) called by the REPL’s display.
Summary:
display(x)tells the current environment to displayxin whatever way it thinks best. This might be a graphical display in something like a Jupyter notebook. By default (e.g. in scripts or in the text REPL), it callsshow(io, "text/plain", x)or equivalentlyshow(io, MIME"text/plain"(), x)for an appropriateiostream. (In the REPL,iois anIOContextwrapper aroundstdout.) The REPL usesdisplayto output the result of an evaluated expression.- The 3-argument
show(io, ::MIME"text/plain", x)method is verbose pretty-printing ofx. By default (if no verbose method is defined fortypeof(x)), it calls the 2-argumentshow(io, x). - The 2-argument
show(io, x)is the default simple text representation ofx. It is what is used byrepr(x), and is typically the format you might use to inputxinto Julia. The 1-argumentshow(x)callsshow(stdout, x). print(x)callsprint(stdout, x), which by default callsshow(stdout, x). It mainly differs fromshowwhenxis a string, whereprintoutputs the raw text butshowoutputs an escaped string enclosed in quotation marks.
Update May 2024: a version of this summary should be added to the manual (julia#54547).