Why extend Core.eval vs. Base.MainInclude.eval?
What is the benefit of extending Core.eval instead of Base.MainInclude.eval? I.e. could these lines instead be Base.MainInclude.eval(rulenode::RuleNode, grammar::Grammar) = Core.eval(Main, get_executable(rulenode, grammar))? This might make more sense with the desired usage eval(rulenode, grammar) extending eval(expr) rather than Core.eval(rulenode, grammar) extending Core.eval(m::Module, expr).
I think you are right. Can you elaborate a bit on the benefit of doing it that way?
:smile:
julia> Core.eval === Base.MainInclude.eval
true
xref https://github.com/JuliaLang/julia/issues/54532
https://github.com/JuliaLang/julia/issues/54057#issuecomment-2051353859 recommends using Core.eval directly.