-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve inference with a function over a closure
The previous code pattern using `takewhile` relied on Julia's type inference to produce correct results. In particular, it relied on `takewhile(f, x) |> collect` to correctly infer to `Vector{Pair{<:Any, Char}}`. However, type inference in Julia is an optimization, and should not be relied on to produce the correct answer. Instead, use a normal function to replace the functional style of programming.
- Loading branch information
1 parent
6901610
commit d3aa7e1
Showing
2 changed files
with
51 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters