From ace9c21a2431717ec1438d1a936a9313caf3d39b Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Thu, 17 Oct 2024 08:08:12 +0000 Subject: [PATCH] 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. https://github.com/JuliaLang/julia/pull/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`. --- src/Fuzzy.jl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Fuzzy.jl b/src/Fuzzy.jl index fb47347..596c8d8 100644 --- a/src/Fuzzy.jl +++ b/src/Fuzzy.jl @@ -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