-
-
Notifications
You must be signed in to change notification settings - Fork 415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
a few more 0.7 updates #672
Changes from 5 commits
83f5958
02b62a4
803d3d0
7e07dd3
bcf81ca
02e9630
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -202,7 +202,7 @@ function clear_history(indices) | |
end | ||
|
||
# since a range could be huge, intersect it with 1:n first | ||
clear_history(r::AbstractRange{T}) where {T<:Integer} = | ||
clear_history(r::AbstractRange{<:Integer}) = | ||
invoke(clear_history, Tuple{Any}, intersect(r, 1:n)) | ||
|
||
function clear_history() | ||
|
@@ -273,7 +273,8 @@ push_postexecute_hook(f::Function) = push!(postexecute_hooks, f) | |
Remove a function `f()` from the list of functions to | ||
execute after executing any notebook cell. | ||
""" | ||
pop_postexecute_hook(f::Function) = splice!(postexecute_hooks, findfirst(equalto(f), postexecute_hooks)) | ||
pop_postexecute_hook(f::Function) = | ||
splice!(postexecute_hooks, findlast(isequal(f), postexecute_hooks)) | ||
|
||
const preexecute_hooks = Function[] | ||
""" | ||
|
@@ -289,7 +290,8 @@ push_preexecute_hook(f::Function) = push!(preexecute_hooks, f) | |
Remove a function `f()` from the list of functions to | ||
execute before executing any notebook cell. | ||
""" | ||
pop_preexecute_hook(f::Function) = splice!(preexecute_hooks, findfirst(equalto(f), preexecute_hooks)) | ||
pop_preexecute_hook(f::Function) = | ||
splice!(preexecute_hooks, findlast(isequal(f), preexecute_hooks)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn’t need it. If f isn’t found, whether findlast returns 0 or nothing splice! will throw. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (But I guess it wouldn't hurt to make sure it throws the same exception on 0.6 and 0.7.) |
||
|
||
# similar, but called after an error (e.g. to reset plotting state) | ||
const posterror_hooks = Function[] | ||
|
@@ -306,7 +308,8 @@ push_posterror_hook(f::Function) = push!(posterror_hooks, f) | |
Remove a function `f()` from the list of functions to | ||
execute after an error occurs when a notebook cell is evaluated. | ||
""" | ||
pop_posterror_hook(f::Function) = splice!(posterror_hooks, findfirst(equalto(f), posterror_hooks)) | ||
pop_posterror_hook(f::Function) = | ||
splice!(posterror_hooks, findlast(isequal(f), posterror_hooks)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
####################################################################### | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compat.
?