Skip to content

Commit ace9c21

Browse files
committed
Don't accidentally extend implicit eval function
This package uses the name `eval`, which is ordinarily reserved for the implicitly provided `eval` function provided by the core system. Adding methods to this generic function worked accidentally due to the way the implementation works, but is probably neither what you want nor guarateed to keep working (e.g. JuliaLang/julia#55949 would break it if merged). To address the issue, make `Fuzzy` a baremodule to avoid implicitly creating the `include`/`eval` names and then add back explicit imports of Base and a definition of `include`. This way, `Fuzzy.eval` is completely decoupled from the core notion of `eval`.
1 parent 1f5f9e2 commit ace9c21

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Fuzzy.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
module Fuzzy
1+
baremodule Fuzzy
2+
3+
# We use the name `eval`, which is ordinarily reserved for the implicitly
4+
# added eval/include functions. To avoid having julia add these names, we
5+
# use `baremodule` above and add back the Base imports here.
6+
using Base
7+
include(args...) = Base.include(Fuzzy, args...)
28

39
export TriangularMF, GaussianMF, BellMF, TrapezoidalMF, SigmoidMF
410

0 commit comments

Comments
 (0)