Currently: (in the demo REPL on the home page)
nd(func,t) = (func(t+1e-10)-func(t))/1e-10
nd(func, t)
nd(exp,2)
Error: Undefined function func
[this came up in investigating PR #2392.]
But given that function objects can be created by function assignment, there doesn't seem to be any particular reason why in evaluation of nd, func can't be bound to the meaning of exp so that this evaluation will work. If there is interest in adding this capability to mathjs, I would be happy to work on a PR (although possibly we will run into some closure/funargs issues -- but since programming languages solve those, I should think mathjs can as well).
Currently: (in the demo REPL on the home page)
[this came up in investigating PR #2392.]
But given that function objects can be created by function assignment, there doesn't seem to be any particular reason why in evaluation of nd,
funccan't be bound to the meaning ofexpso that this evaluation will work. If there is interest in adding this capability to mathjs, I would be happy to work on a PR (although possibly we will run into some closure/funargs issues -- but since programming languages solve those, I should think mathjs can as well).