@@ -10,10 +10,10 @@ if `io` is not given) a canonical (un-decorated) text representation.
10
10
The representation used by `print` includes minimal formatting and tries to
11
11
avoid Julia-specific details.
12
12
13
- `print` falls back to calling `show`, so most types should just define
14
- `show`. Define `print` if your type has a separate "plain" representation.
15
- For example, `show` displays strings with quotes, and `print` displays strings
16
- without quotes.
13
+ `print` falls back to calling the 2-argument `show(io, x)` for each argument `x` in `xs`,
14
+ so most types should just define `show`. Define `print` if your type has a separate
15
+ "plain" representation. For example, `show` displays strings with quotes, and `print`
16
+ displays strings without quotes.
17
17
18
18
See also [`println`](@ref), [`string`](@ref), [`printstyled`](@ref).
19
19
@@ -252,8 +252,8 @@ print(io::IO, s::Union{String,SubString{String}}) = (write(io, s); nothing)
252
252
"""
253
253
repr(x; context=nothing)
254
254
255
- Create a string from any value using the [ `show`](@ref) function.
256
- You should not add methods to `repr`; define a `show` method instead.
255
+ Create a string from any value using the 2-argument `show(io, x)` function.
256
+ You should not add methods to `repr`; define a [ `show`](@ref) method instead.
257
257
258
258
The optional keyword argument `context` can be set to a `:key=>value` pair, a
259
259
tuple of `:key=>value` pairs, or an `IO` or [`IOContext`](@ref) object whose
@@ -262,7 +262,7 @@ attributes are used for the I/O stream passed to `show`.
262
262
Note that `repr(x)` is usually similar to how the value of `x` would
263
263
be entered in Julia. See also [`repr(MIME("text/plain"), x)`](@ref) to instead
264
264
return a "pretty-printed" version of `x` designed more for human consumption,
265
- equivalent to the REPL display of `x`.
265
+ equivalent to the REPL display of `x`, using the 3-argument `show(io, mime, x)` .
266
266
267
267
!!! compat "Julia 1.7"
268
268
Passing a tuple to keyword `context` requires Julia 1.7 or later.
0 commit comments