Skip to content

Commit

Permalink
Don't accidentally extend implicit eval function
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
Keno committed Oct 17, 2024
1 parent 1f5f9e2 commit ace9c21
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Fuzzy.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
module Fuzzy
baremodule Fuzzy

# We use the name `eval`, which is ordinarily reserved for the implicitly
# added eval/include functions. To avoid having julia add these names, we
# use `baremodule` above and add back the Base imports here.
using Base
include(args...) = Base.include(Fuzzy, args...)

export TriangularMF, GaussianMF, BellMF, TrapezoidalMF, SigmoidMF

Expand Down

0 comments on commit ace9c21

Please sign in to comment.