I skipped a step: as Yichao said, the built-in eval is not a generic function so it can't be extended.
my usage is simply that I have type A, say, that defines a function and I > want to call eval(A, arg) to evaluate. I am perfectly happy to just call > `feval` instead of `eval`, but I was curious. It's still a little unclear what the goal is, and AFAIK there is no (built-in) `feval` in Julia. You might want constructors? http://julia.readthedocs.org/en/release-0.3/manual/constructors/ Also note that in 0.4-dev (github master) you will be able to make A directly callable, see: https://github.com/JuliaLang/julia/issues/2403 (and the implementation in #8712) On Thu, Jun 18, 2015 at 11:35 AM, Christoph Ortner < [email protected]> wrote: > I didn't fully understand this: are you saying that, unless I use > `baremodule`, I cannot overload `eval`? > > my usage is simply that I have type A, say, that defines a function and I > want to call eval(A, arg) to evaluate. I am perfectly happy to just call > `feval` instead of `eval`, but I was curious. > > Many thanks, > Christoph >
