johnmyleswhite/Calculus.jl — pull request #33 by Eskatrem (2013-11-27 22:49:14+00:00)
Title: code to treat differentiate as a first class higher order function

I added a macro @define to store the code of a function when creating it, and another one @makeDerivative to create functions that are derivatives. It becomes possible to do:

julia> @define myFunction x cos(x*x)
(anonymous function)

julia> myDer = @makeDerivative myFunction x
(anonymous function)

julia> myDer(sqrt(pi))
-2.0083812473182306e-15

julia> myDer2 = @makeDerivative((x*x*sin(x)),x)
(anonymous function)

julia> myDer2(pi)
-9.869604401089358