Skip to content

Commit 2f3f412

Browse files
committed
deprecate print_escaped, print_unescaped, and print_joined
1 parent 83a4045 commit 2f3f412

File tree

15 files changed

+56
-56
lines changed

15 files changed

+56
-56
lines changed

base/deprecated.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,10 @@ end
12541254

12551255
@deprecate showcompact_lim show
12561256

1257+
@deprecate print_escaped escape_string
1258+
@deprecate print_unescaped unescape_string
1259+
@deprecate print_joined join
1260+
12571261
# During the 0.5 development cycle, do not add any deprecations below this line
12581262
# To be deprecated in 0.6
12591263

base/docs/helpdb/Base.jl

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -784,12 +784,12 @@ Equivalent to `stat(file).mode`
784784
filemode
785785

786786
"""
787-
print_joined(io, items, delim, [last])
787+
join(io, items, delim, [last])
788788
789789
Print elements of `items` to `io` with `delim` between them. If `last` is specified, it is
790790
used as the final delimiter instead of `delim`.
791791
"""
792-
print_joined
792+
join(io, items, delim, last)
793793

794794
"""
795795
lfact(x)
@@ -5043,12 +5043,12 @@ process as a worker using TCP/IP sockets for transport.
50435043
init_worker
50445044

50455045
"""
5046-
print_escaped(io, str::AbstractString, esc::AbstractString)
5046+
escape_string(io, str::AbstractString, esc::AbstractString)
50475047
50485048
General escaping of traditional C and Unicode escape sequences, plus any characters in esc
50495049
are also escaped (with a backslash).
50505050
"""
5051-
print_escaped
5051+
escape_string(io, str, esc)
50525052

50535053
"""
50545054
typejoin(T, S)
@@ -6706,7 +6706,7 @@ two strings. For example
67066706
67076707
`strings` can be any iterable over elements `x` which are convertible to strings via `print(io::IOBuffer, x)`.
67086708
"""
6709-
join
6709+
join(strings, delim, last)
67106710

67116711
"""
67126712
linreg(x, y) -> a, b
@@ -7175,11 +7175,11 @@ implemented.) Use [`vecnorm`](:func:`vecnorm`) to compute the Frobenius norm.
71757175
norm
71767176

71777177
"""
7178-
print_unescaped(io, s::AbstractString)
7178+
unescape_string(io, s::AbstractString)
71797179
7180-
General unescaping of traditional C and Unicode escape sequences. Reverse of [`print_escaped`](:func:`print_escaped`).
7180+
General unescaping of traditional C and Unicode escape sequences. Reverse of [`escape_string`](:func:`escape_string`).
71817181
"""
7182-
print_unescaped
7182+
unescape_string(io, s)
71837183

71847184
"""
71857185
digits!(array, n, [base])
@@ -8779,10 +8779,9 @@ A_ldiv_Bc
87798779
"""
87808780
escape_string(str::AbstractString) -> AbstractString
87818781
8782-
General escaping of traditional C and Unicode escape sequences. See
8783-
[`print_escaped`](:func:`print_escaped`) for more general escaping.
8782+
General escaping of traditional C and Unicode escape sequences.
87848783
"""
8785-
escape_string
8784+
escape_string(str)
87868785

87878786
"""
87888787
significand(x)
@@ -9288,9 +9287,9 @@ map!(f,destination,collection...)
92889287
unescape_string(s::AbstractString) -> AbstractString
92899288
92909289
General unescaping of traditional C and Unicode escape sequences. Reverse of
9291-
[`escape_string`](:func:`escape_string`). See also [`print_unescaped`](:func:`print_unescaped`).
9290+
[`escape_string`](:func:`escape_string`). See also [`unescape_string`](:func:`unescape_string`).
92929291
"""
9293-
unescape_string
9292+
unescape_string(s)
92949293

92959294
"""
92969295
redirect_stdout()

base/docs/utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ function print_joined_cols(io::IO, ss, delim = "", last = delim; cols = displays
284284
total += length(ss[i])
285285
total + max(i-2,0)*length(delim) + (i>1?1:0)*length(last) > cols && (i-=1; break)
286286
end
287-
print_joined(io, ss[1:i], delim, last)
287+
join(io, ss[1:i], delim, last)
288288
end
289289

290290
print_joined_cols(args...; cols = displaysize(STDOUT)[2]) = print_joined_cols(STDOUT, args...; cols=cols)

base/exports.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -853,10 +853,7 @@ export
853853
oct,
854854
prevind,
855855
print,
856-
print_escaped,
857-
print_joined,
858856
print_shortest,
859-
print_unescaped,
860857
print_with_color,
861858
println,
862859
randstring,

base/markdown/GitHub/table.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,11 @@ function plain(io::IO, md::Table)
107107
padcells!(cells, md.align, len = length, min = 3)
108108
for i = 1:length(cells) # fixme (iter): can we make indexing more general here?
109109
print(io, "| ")
110-
print_joined(io, cells[i], " | ")
110+
join(io, cells[i], " | ")
111111
println(io, " |")
112112
if i == 1
113113
print(io, "|")
114-
print_joined(io, [_dash(length(cells[i][j]), md.align[j]) for j = 1:length(cells[1])], "|")
114+
join(io, [_dash(length(cells[i][j]), md.align[j]) for j = 1:length(cells[1])], "|")
115115
println(io, "|")
116116
end
117117
end
@@ -124,7 +124,7 @@ function rst(io::IO, md::Table)
124124
double = ["="^length(c) for c in cells[1]]
125125
function print_row(row, row_sep, col_sep)
126126
print(io, col_sep, row_sep)
127-
print_joined(io, row, string(row_sep, col_sep, row_sep))
127+
join(io, row, string(row_sep, col_sep, row_sep))
128128
println(io, row_sep, col_sep)
129129
end
130130
print_row(single, '-', '+')
@@ -139,10 +139,10 @@ function term(io::IO, md::Table, columns)
139139
cells = mapmap(terminline, md.rows)
140140
padcells!(cells, md.align, len = ansi_length)
141141
for i = 1:length(cells)
142-
print_joined(io, cells[i], " ")
142+
join(io, cells[i], " ")
143143
println(io)
144144
if i == 1
145-
print_joined(io, [""^ansi_length(cells[i][j]) for j = 1:length(cells[1])], " ")
145+
join(io, [""^ansi_length(cells[i][j]) for j = 1:length(cells[1])], " ")
146146
println(io)
147147
end
148148
end

base/methodshow.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ function show(io::IO, m::Method; kwtype::Nullable{DataType}=Nullable{DataType}()
105105
show_delim_array(io, tv, '{', ',', '}', false)
106106
end
107107
print(io, "(")
108-
print_joined(io, [isempty(d[2]) ? d[1] : d[1]*"::"*d[2] for d in decls[2:end]],
108+
join(io, [isempty(d[2]) ? d[1] : d[1]*"::"*d[2] for d in decls[2:end]],
109109
", ", ", ")
110110
if !isnull(kwtype)
111111
kwargs = kwarg_decl(m.sig, get(kwtype))
112112
if !isempty(kwargs)
113113
print(io, "; ")
114-
print_joined(io, kwargs, ", ", ", ")
114+
join(io, kwargs, ", ", ", ")
115115
end
116116
end
117117
print(io, ")")
@@ -227,13 +227,13 @@ function writemime(io::IO, ::MIME"text/html", m::Method; kwtype::Nullable{DataTy
227227
print(io,"</i>")
228228
end
229229
print(io, "(")
230-
print_joined(io, [isempty(d[2]) ? d[1] : d[1]*"::<b>"*d[2]*"</b>"
230+
join(io, [isempty(d[2]) ? d[1] : d[1]*"::<b>"*d[2]*"</b>"
231231
for d in decls[2:end]], ", ", ", ")
232232
if !isnull(kwtype)
233233
kwargs = kwarg_decl(m.sig, get(kwtype))
234234
if !isempty(kwargs)
235235
print(io, "; <i>")
236-
print_joined(io, kwargs, ", ", ", ")
236+
join(io, kwargs, ", ", ", ")
237237
print(io, "</i>")
238238
end
239239
end

base/pkg/types.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function VersionSet(versions::Vector{VersionNumber})
3636
end
3737
VersionSet(versions::VersionNumber...) = VersionSet(VersionNumber[versions...])
3838

39-
show(io::IO, s::VersionSet) = print_joined(io, s.intervals, "")
39+
show(io::IO, s::VersionSet) = join(io, s.intervals, "")
4040
isempty(s::VersionSet) = all(i->isempty(i), s.intervals)
4141
in(v::VersionNumber, s::VersionSet) = any(i->in(v,i), s.intervals)
4242
function intersect(A::VersionSet, B::VersionSet)

base/precompile.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,11 @@ precompile(Base.print, (IOBuffer, String))
303303
precompile(Base.print, (IOBuffer, VersionNumber))
304304
precompile(Base.print, (IOStream, Int32))
305305
precompile(Base.print, (IOStream,String))
306-
precompile(Base.print_joined, (IOBuffer, Tuple{String}, Char))
307-
precompile(Base.print_joined, (IOBuffer, Tuple{Int}, Char))
308-
precompile(Base.print_joined, (IOBuffer, Array{String,1}, Char))
309-
precompile(Base.print_joined, (IOBuffer, Array{AbstractString,1}, String))
310-
precompile(Base.print_joined, (IOBuffer, Array{SubString{String}, 1}, String))
306+
precompile(Base.join, (IOBuffer, Tuple{String}, Char))
307+
precompile(Base.join, (IOBuffer, Tuple{Int}, Char))
308+
precompile(Base.join, (IOBuffer, Array{String,1}, Char))
309+
precompile(Base.join, (IOBuffer, Array{AbstractString,1}, String))
310+
precompile(Base.join, (IOBuffer, Array{SubString{String}, 1}, String))
311311
precompile(Base.println, (Base.TTY,))
312312
precompile(Base.println, (Base.Terminals.TTYTerminal,))
313313
precompile(Base.promote_type, (Type{Base.LineEdit.Prompt}, Type{Base.LineEdit.HistoryPrompt{Base.REPL.REPLHistoryProvider}}))
@@ -452,7 +452,7 @@ precompile(==, (Base.RemoteChannel, WeakRef))
452452
precompile(==, (Base.RemoteChannel, Base.RemoteChannel))
453453
precompile(Base.send_del_client, (Base.RemoteChannel,))
454454
precompile(!=, (Base.SubString{String}, String))
455-
precompile(Base.print_joined, (Base.IOBuffer, Array{Base.SubString{String}, 1}, String))
455+
precompile(Base.join, (Base.IOBuffer, Array{Base.SubString{String}, 1}, String))
456456
precompile(Base.joinpath, (String, String, String, String))
457457
precompile(Base.string, (String, String, Char))
458458
precompile(Base.string, (String, String, Int))

base/replutil.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function showerror(io::IO, ex::BoundsError)
2323
if isa(ex.i, Range)
2424
print(io, ex.i)
2525
else
26-
print_joined(io, ex.i, ',')
26+
join(io, ex.i, ',')
2727
end
2828
print(io, ']')
2929
end

base/show.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ function show_unquoted(io::IO, ex::Expr, indent::Int, prec::Int)
891891
end
892892
print(io, ")")
893893
else
894-
print_escaped(io, x, "\"\$")
894+
escape_string(io, x, "\"\$")
895895
end
896896
end
897897
print(io, '"')

0 commit comments

Comments
 (0)