Skip to content

Commit 81d98a3

Browse files
authored
corrections to history function (fixes JuliaLang#706)
1 parent 9ebc928 commit 81d98a3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/IJulia.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,17 +231,17 @@ clear_history
231231

232232
#######################################################################
233233
# methods to print history or any subset thereof
234-
function history(io::IO, indices::AbstractVector{Int})
234+
function history(io::IO, indices::AbstractVector{<:Integer})
235235
for n in intersect(indices, 1:IJulia.n)
236236
if haskey(In, n)
237-
print(In[n])
237+
print(io, In[n])
238238
end
239239
end
240240
end
241241

242-
history(io::IO, x::Union{Integer,AbstractVector{Int}}...) = history(io, vcat(x...))
242+
history(io::IO, x::Union{Integer,AbstractVector{<:Integer}}...) = history(io, vcat(x...))
243243
history(x...) = history(stdout, x...)
244-
history(io::IO, x...) = throw(MethodError(history, (x...,)))
244+
history(io::IO, x...) = throw(MethodError(history, (io, x...,)))
245245
history() = history(1:n)
246246
"""
247247
history([io], [indices...])

0 commit comments

Comments
 (0)