From 81d98a3466db9843b26f6a294c8ca0b544d390c2 Mon Sep 17 00:00:00 2001 From: "Steven G. Johnson" Date: Thu, 16 Aug 2018 09:48:32 -0400 Subject: [PATCH] corrections to history function (fixes #706) --- src/IJulia.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/IJulia.jl b/src/IJulia.jl index 389b3045..3b531d48 100644 --- a/src/IJulia.jl +++ b/src/IJulia.jl @@ -231,17 +231,17 @@ clear_history ####################################################################### # methods to print history or any subset thereof -function history(io::IO, indices::AbstractVector{Int}) +function history(io::IO, indices::AbstractVector{<:Integer}) for n in intersect(indices, 1:IJulia.n) if haskey(In, n) - print(In[n]) + print(io, In[n]) end end end -history(io::IO, x::Union{Integer,AbstractVector{Int}}...) = history(io, vcat(x...)) +history(io::IO, x::Union{Integer,AbstractVector{<:Integer}}...) = history(io, vcat(x...)) history(x...) = history(stdout, x...) -history(io::IO, x...) = throw(MethodError(history, (x...,))) +history(io::IO, x...) = throw(MethodError(history, (io, x...,))) history() = history(1:n) """ history([io], [indices...])