diff --git a/base/deprecated.jl b/base/deprecated.jl
index b4524301d20d0..4f6c094501754 100644
--- a/base/deprecated.jl
+++ b/base/deprecated.jl
@@ -1268,6 +1268,10 @@ end
@deprecate blas_set_num_threads BLAS.set_num_threads
+@deprecate print_escaped escape_string
+@deprecate print_unescaped unescape_string
+@deprecate print_joined join
+
# During the 0.5 development cycle, do not add any deprecations below this line
# To be deprecated in 0.6
diff --git a/base/docs/helpdb/Base.jl b/base/docs/helpdb/Base.jl
index 790d8f5c33fda..8aeb00eb6c247 100644
--- a/base/docs/helpdb/Base.jl
+++ b/base/docs/helpdb/Base.jl
@@ -784,12 +784,12 @@ Equivalent to `stat(file).mode`
filemode
"""
- print_joined(io, items, delim, [last])
+ join(io, items, delim, [last])
Print elements of `items` to `io` with `delim` between them. If `last` is specified, it is
used as the final delimiter instead of `delim`.
"""
-print_joined
+join(io, items, delim, last)
"""
lfact(x)
@@ -5013,12 +5013,12 @@ process as a worker using TCP/IP sockets for transport.
init_worker
"""
- print_escaped(io, str::AbstractString, esc::AbstractString)
+ escape_string(io, str::AbstractString, esc::AbstractString)
General escaping of traditional C and Unicode escape sequences, plus any characters in esc
are also escaped (with a backslash).
"""
-print_escaped
+escape_string(io, str, esc)
"""
typejoin(T, S)
@@ -6669,7 +6669,7 @@ two strings. For example
`strings` can be any iterable over elements `x` which are convertible to strings via `print(io::IOBuffer, x)`.
"""
-join
+join(strings, delim, last)
"""
linreg(x, y) -> a, b
@@ -7138,11 +7138,11 @@ implemented.) Use [`vecnorm`](:func:`vecnorm`) to compute the Frobenius norm.
norm
"""
- print_unescaped(io, s::AbstractString)
+ unescape_string(io, s::AbstractString)
-General unescaping of traditional C and Unicode escape sequences. Reverse of [`print_escaped`](:func:`print_escaped`).
+General unescaping of traditional C and Unicode escape sequences. Reverse of [`escape_string`](:func:`escape_string`).
"""
-print_unescaped
+unescape_string(io, s)
"""
digits!(array, n, [base])
@@ -8678,10 +8678,9 @@ A_ldiv_Bc
"""
escape_string(str::AbstractString) -> AbstractString
-General escaping of traditional C and Unicode escape sequences. See
-[`print_escaped`](:func:`print_escaped`) for more general escaping.
+General escaping of traditional C and Unicode escape sequences.
"""
-escape_string
+escape_string(str)
"""
significand(x)
@@ -9187,9 +9186,9 @@ map!(f,destination,collection...)
unescape_string(s::AbstractString) -> AbstractString
General unescaping of traditional C and Unicode escape sequences. Reverse of
-[`escape_string`](:func:`escape_string`). See also [`print_unescaped`](:func:`print_unescaped`).
+[`escape_string`](:func:`escape_string`). See also [`unescape_string`](:func:`unescape_string`).
"""
-unescape_string
+unescape_string(s)
"""
redirect_stdout()
diff --git a/base/docs/utils.jl b/base/docs/utils.jl
index 67d2bb860b1ed..41372e93995b2 100644
--- a/base/docs/utils.jl
+++ b/base/docs/utils.jl
@@ -284,7 +284,7 @@ function print_joined_cols(io::IO, ss, delim = "", last = delim; cols = displays
total += length(ss[i])
total + max(i-2,0)*length(delim) + (i>1?1:0)*length(last) > cols && (i-=1; break)
end
- print_joined(io, ss[1:i], delim, last)
+ join(io, ss[1:i], delim, last)
end
print_joined_cols(args...; cols = displaysize(STDOUT)[2]) = print_joined_cols(STDOUT, args...; cols=cols)
diff --git a/base/exports.jl b/base/exports.jl
index 86cd581b4d6f7..3d7a953c7a99b 100644
--- a/base/exports.jl
+++ b/base/exports.jl
@@ -847,10 +847,7 @@ export
oct,
prevind,
print,
- print_escaped,
- print_joined,
print_shortest,
- print_unescaped,
print_with_color,
println,
randstring,
diff --git a/base/markdown/GitHub/table.jl b/base/markdown/GitHub/table.jl
index 46a85bf99eacd..b02d2ecaded51 100644
--- a/base/markdown/GitHub/table.jl
+++ b/base/markdown/GitHub/table.jl
@@ -107,11 +107,11 @@ function plain(io::IO, md::Table)
padcells!(cells, md.align, len = length, min = 3)
for i = 1:length(cells) # fixme (iter): can we make indexing more general here?
print(io, "| ")
- print_joined(io, cells[i], " | ")
+ join(io, cells[i], " | ")
println(io, " |")
if i == 1
print(io, "|")
- print_joined(io, [_dash(length(cells[i][j]), md.align[j]) for j = 1:length(cells[1])], "|")
+ join(io, [_dash(length(cells[i][j]), md.align[j]) for j = 1:length(cells[1])], "|")
println(io, "|")
end
end
@@ -124,7 +124,7 @@ function rst(io::IO, md::Table)
double = ["="^length(c) for c in cells[1]]
function print_row(row, row_sep, col_sep)
print(io, col_sep, row_sep)
- print_joined(io, row, string(row_sep, col_sep, row_sep))
+ join(io, row, string(row_sep, col_sep, row_sep))
println(io, row_sep, col_sep)
end
print_row(single, '-', '+')
@@ -139,10 +139,10 @@ function term(io::IO, md::Table, columns)
cells = mapmap(terminline, md.rows)
padcells!(cells, md.align, len = ansi_length)
for i = 1:length(cells)
- print_joined(io, cells[i], " ")
+ join(io, cells[i], " ")
println(io)
if i == 1
- print_joined(io, ["–"^ansi_length(cells[i][j]) for j = 1:length(cells[1])], " ")
+ join(io, ["–"^ansi_length(cells[i][j]) for j = 1:length(cells[1])], " ")
println(io)
end
end
diff --git a/base/methodshow.jl b/base/methodshow.jl
index 2b6409adc6585..44d1a414337c6 100644
--- a/base/methodshow.jl
+++ b/base/methodshow.jl
@@ -105,13 +105,13 @@ function show(io::IO, m::Method; kwtype::Nullable{DataType}=Nullable{DataType}()
show_delim_array(io, tv, '{', ',', '}', false)
end
print(io, "(")
- print_joined(io, [isempty(d[2]) ? d[1] : d[1]*"::"*d[2] for d in decls[2:end]],
+ join(io, [isempty(d[2]) ? d[1] : d[1]*"::"*d[2] for d in decls[2:end]],
", ", ", ")
if !isnull(kwtype)
kwargs = kwarg_decl(m.sig, get(kwtype))
if !isempty(kwargs)
print(io, "; ")
- print_joined(io, kwargs, ", ", ", ")
+ join(io, kwargs, ", ", ", ")
end
end
print(io, ")")
@@ -227,13 +227,13 @@ function writemime(io::IO, ::MIME"text/html", m::Method; kwtype::Nullable{DataTy
print(io,"")
end
print(io, "(")
- print_joined(io, [isempty(d[2]) ? d[1] : d[1]*"::"*d[2]*""
+ join(io, [isempty(d[2]) ? d[1] : d[1]*"::"*d[2]*""
for d in decls[2:end]], ", ", ", ")
if !isnull(kwtype)
kwargs = kwarg_decl(m.sig, get(kwtype))
if !isempty(kwargs)
print(io, "; ")
- print_joined(io, kwargs, ", ", ", ")
+ join(io, kwargs, ", ", ", ")
print(io, "")
end
end
diff --git a/base/pkg/types.jl b/base/pkg/types.jl
index afd6e02929148..152b3e5af0c24 100644
--- a/base/pkg/types.jl
+++ b/base/pkg/types.jl
@@ -36,7 +36,7 @@ function VersionSet(versions::Vector{VersionNumber})
end
VersionSet(versions::VersionNumber...) = VersionSet(VersionNumber[versions...])
-show(io::IO, s::VersionSet) = print_joined(io, s.intervals, " ∪ ")
+show(io::IO, s::VersionSet) = join(io, s.intervals, " ∪ ")
isempty(s::VersionSet) = all(i->isempty(i), s.intervals)
in(v::VersionNumber, s::VersionSet) = any(i->in(v,i), s.intervals)
function intersect(A::VersionSet, B::VersionSet)
diff --git a/base/precompile.jl b/base/precompile.jl
index b70c331c18f0e..eb8b01b30b7de 100644
--- a/base/precompile.jl
+++ b/base/precompile.jl
@@ -303,11 +303,11 @@ precompile(Base.print, (IOBuffer, String))
precompile(Base.print, (IOBuffer, VersionNumber))
precompile(Base.print, (IOStream, Int32))
precompile(Base.print, (IOStream,String))
-precompile(Base.print_joined, (IOBuffer, Tuple{String}, Char))
-precompile(Base.print_joined, (IOBuffer, Tuple{Int}, Char))
-precompile(Base.print_joined, (IOBuffer, Array{String,1}, Char))
-precompile(Base.print_joined, (IOBuffer, Array{AbstractString,1}, String))
-precompile(Base.print_joined, (IOBuffer, Array{SubString{String}, 1}, String))
+precompile(Base.join, (IOBuffer, Tuple{String}, Char))
+precompile(Base.join, (IOBuffer, Tuple{Int}, Char))
+precompile(Base.join, (IOBuffer, Array{String,1}, Char))
+precompile(Base.join, (IOBuffer, Array{AbstractString,1}, String))
+precompile(Base.join, (IOBuffer, Array{SubString{String}, 1}, String))
precompile(Base.println, (Base.TTY,))
precompile(Base.println, (Base.Terminals.TTYTerminal,))
precompile(Base.promote_type, (Type{Base.LineEdit.Prompt}, Type{Base.LineEdit.HistoryPrompt{Base.REPL.REPLHistoryProvider}}))
@@ -452,7 +452,7 @@ precompile(==, (Base.RemoteChannel, WeakRef))
precompile(==, (Base.RemoteChannel, Base.RemoteChannel))
precompile(Base.send_del_client, (Base.RemoteChannel,))
precompile(!=, (Base.SubString{String}, String))
-precompile(Base.print_joined, (Base.IOBuffer, Array{Base.SubString{String}, 1}, String))
+precompile(Base.join, (Base.IOBuffer, Array{Base.SubString{String}, 1}, String))
precompile(Base.joinpath, (String, String, String, String))
precompile(Base.string, (String, String, Char))
precompile(Base.string, (String, String, Int))
diff --git a/base/replutil.jl b/base/replutil.jl
index 6cef41b054f29..1074990af5bce 100644
--- a/base/replutil.jl
+++ b/base/replutil.jl
@@ -23,7 +23,7 @@ function showerror(io::IO, ex::BoundsError)
if isa(ex.i, Range)
print(io, ex.i)
else
- print_joined(io, ex.i, ',')
+ join(io, ex.i, ',')
end
print(io, ']')
end
diff --git a/base/show.jl b/base/show.jl
index 520b81362bda7..7cdffeec538fb 100644
--- a/base/show.jl
+++ b/base/show.jl
@@ -891,7 +891,7 @@ function show_unquoted(io::IO, ex::Expr, indent::Int, prec::Int)
end
print(io, ")")
else
- print_escaped(io, x, "\"\$")
+ escape_string(io, x, "\"\$")
end
end
print(io, '"')
diff --git a/base/strings/io.jl b/base/strings/io.jl
index 8b13e360ff47e..4878569dd9dd4 100644
--- a/base/strings/io.jl
+++ b/base/strings/io.jl
@@ -96,7 +96,7 @@ IOBuffer(str::String) = IOBuffer(str.data)
IOBuffer(s::SubString{String}) = IOBuffer(sub(s.string.data, s.offset + 1 : s.offset + sizeof(s)))
# join is implemented using IO
-function print_joined(io, strings, delim, last)
+function join(io::IO, strings, delim, last)
i = start(strings)
if done(strings,i)
return
@@ -112,7 +112,7 @@ function print_joined(io, strings, delim, last)
end
end
-function print_joined(io, strings, delim)
+function join(io::IO, strings, delim)
i = start(strings)
is_done = done(strings,i)
while !is_done
@@ -124,16 +124,16 @@ function print_joined(io, strings, delim)
end
end
end
-print_joined(io, strings) = print_joined(io, strings, "")
+join(io::IO, strings) = join(io, strings, "")
-join(args...) = sprint(print_joined, args...)
+join(args...) = sprint(join, args...)
## string escaping & unescaping ##
escape_nul(s::AbstractString, i::Int) =
!done(s,i) && '0' <= next(s,i)[1] <= '7' ? "\\x00" : "\\0"
-function print_escaped(io, s::AbstractString, esc::AbstractString)
+function escape_string(io, s::AbstractString, esc::AbstractString)
i = start(s)
while !done(s,i)
c, j = next(s,i)
@@ -150,10 +150,10 @@ function print_escaped(io, s::AbstractString, esc::AbstractString)
end
end
-escape_string(s::AbstractString) = sprint(endof(s), print_escaped, s, "\"")
+escape_string(s::AbstractString) = sprint(endof(s), escape_string, s, "\"")
function print_quoted(io, s::AbstractString)
print(io, '"')
- print_escaped(io, s, "\"\$") #"# work around syntax highlighting problem
+ escape_string(io, s, "\"\$") #"# work around syntax highlighting problem
print(io, '"')
end
@@ -178,7 +178,7 @@ unescape_chars(s::AbstractString, esc::AbstractString) =
# general unescaping of traditional C and Unicode escape sequences
-function print_unescaped(io, s::AbstractString)
+function unescape_string(io, s::AbstractString)
i = start(s)
while !done(s,i)
c, i = next(s,i)
@@ -231,7 +231,7 @@ function print_unescaped(io, s::AbstractString)
end
end
-unescape_string(s::AbstractString) = sprint(endof(s), print_unescaped, s)
+unescape_string(s::AbstractString) = sprint(endof(s), unescape_string, s)
macro b_str(s); :($(unescape_string(s)).data); end
diff --git a/base/version.jl b/base/version.jl
index e9724d6157223..024a034f0dd42 100644
--- a/base/version.jl
+++ b/base/version.jl
@@ -54,11 +54,11 @@ function print(io::IO, v::VersionNumber)
print(io, v.patch)
if !isempty(v.prerelease)
print(io, '-')
- print_joined(io, v.prerelease,'.')
+ join(io, v.prerelease,'.')
end
if !isempty(v.build)
print(io, '+')
- print_joined(io, v.build,'.')
+ join(io, v.build,'.')
end
end
show(io::IO, v::VersionNumber) = print(io, "v\"", v, "\"")
diff --git a/doc/stdlib/io-network.rst b/doc/stdlib/io-network.rst
index f479e75294d77..72a3ebdcabe13 100644
--- a/doc/stdlib/io-network.rst
+++ b/doc/stdlib/io-network.rst
@@ -302,19 +302,19 @@ General I/O
Read a value written by ``serialize``\ . ``deserialize`` assumes the binary data read from ``stream`` is correct and has been serialized by a compatible implementation of ``serialize``\ . It has been designed with simplicity and performance as a goal and does not validate the data read. Malformed data can result in process termination. The caller has to ensure the integrity and correctness of data read from ``stream``\ .
-.. function:: print_escaped(io, str::AbstractString, esc::AbstractString)
+.. function:: escape_string(io, str::AbstractString, esc::AbstractString)
.. Docstring generated from Julia source
General escaping of traditional C and Unicode escape sequences, plus any characters in esc are also escaped (with a backslash).
-.. function:: print_unescaped(io, s::AbstractString)
+.. function:: unescape_string(io, s::AbstractString)
.. Docstring generated from Julia source
- General unescaping of traditional C and Unicode escape sequences. Reverse of :func:`print_escaped`\ .
+ General unescaping of traditional C and Unicode escape sequences. Reverse of :func:`escape_string`\ .
-.. function:: print_joined(io, items, delim, [last])
+.. function:: join(io, items, delim, [last])
.. Docstring generated from Julia source
diff --git a/doc/stdlib/strings.rst b/doc/stdlib/strings.rst
index 145447820ae57..be71d5b7f3de3 100644
--- a/doc/stdlib/strings.rst
+++ b/doc/stdlib/strings.rst
@@ -451,13 +451,13 @@
.. Docstring generated from Julia source
- General escaping of traditional C and Unicode escape sequences. See :func:`print_escaped` for more general escaping.
+ General escaping of traditional C and Unicode escape sequences.
.. function:: unescape_string(s::AbstractString) -> AbstractString
.. Docstring generated from Julia source
- General unescaping of traditional C and Unicode escape sequences. Reverse of :func:`escape_string`\ . See also :func:`print_unescaped`\ .
+ General unescaping of traditional C and Unicode escape sequences. Reverse of :func:`escape_string`\ . See also :func:`unescape_string`\ .
.. function:: utf16(s)
diff --git a/test/strings/io.jl b/test/strings/io.jl
index 6ef38d97b5bee..a07662d1098f2 100644
--- a/test/strings/io.jl
+++ b/test/strings/io.jl
@@ -228,15 +228,15 @@ Base.next(jt::i9178, n) = (jt.nnext += 1 ; ("$(jt.nnext),$(jt.ndone)", n+1))
arr = ["a","b","c"]
@test "[$(join(arr, " - "))]" == "[a - b - c]"
-# print_joined with empty input
+# join with empty input
myio = IOBuffer()
-print_joined(myio, "", "", 1)
+join(myio, "", "", 1)
@test isempty(takebuf_array(myio))
# unescape_chars
@test Base.unescape_chars("\\t","t") == "t"
-@test_throws ArgumentError print_unescaped(IOBuffer(), string('\\',"xZ"))
-@test_throws ArgumentError print_unescaped(IOBuffer(), string('\\',"777"))
+@test_throws ArgumentError unescape_string(IOBuffer(), string('\\',"xZ"))
+@test_throws ArgumentError unescape_string(IOBuffer(), string('\\',"777"))
# 11659
# The indentation code was not correctly counting tab stops