Skip to content

Commit 8aa5e77

Browse files
committed
explicit keyword not INIT
1 parent 2522f67 commit 8aa5e77

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/functor.jl

+5-5
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ function _default_walk(f, x)
4343
re(map(f, func))
4444
end
4545

46-
const INIT = Base._InitialValue() # sentinel value for keyword not supplied
46+
@gensym nokeyword
4747

48-
function fmap(f, x; exclude = isleaf, walk = _default_walk, cache = IdDict(), prune = INIT)
49-
haskey(cache, x) && return prune === INIT ? cache[x] : prune
48+
function fmap(f, x; exclude = isleaf, walk = _default_walk, cache = IdDict(), prune = nokeyword)
49+
haskey(cache, x) && return prune === nokeyword ? cache[x] : prune
5050
cache[x] = exclude(x) ? f(x) : walk(x -> fmap(f, x; exclude, walk, cache, prune), x)
5151
end
5252

@@ -73,8 +73,8 @@ end
7373
### Vararg forms
7474
###
7575

76-
function fmap(f, x, ys...; exclude = isleaf, walk = _default_walk, cache = IdDict(), prune = INIT)
77-
haskey(cache, x) && return prune === INIT ? cache[x] : prune
76+
function fmap(f, x, ys...; exclude = isleaf, walk = _default_walk, cache = IdDict(), prune = nokeyword)
77+
haskey(cache, x) && return prune === nokeyword ? cache[x] : prune
7878
cache[x] = exclude(x) ? f(x, ys...) : walk((xy...,) -> fmap(f, xy...; exclude, walk, cache, prune), x, ys...)
7979
end
8080

0 commit comments

Comments
 (0)