Calling single functions is nice and very useful, but sometimes we may have a number of operations in a file that we want to call from Clojure. Clojuratica allow us to do that also.
We must first have Clojuratica and Mathematica talking to each other. Either complete the Setting up Mathematica to talk to Clojuratica for Mac OS X and Linux recipe or the Setting up Mathematica to talk to Clojuratica for Windows recipe. Also, you'll need to have the init-mma
function called.
Also, make sure that the clojuratica
namespace is imported into our script or REPL.
(use 'clojuratica)
And we need a Mathematica file to run. I created one called line-integral.m
, and it just contains the following lines:
SyntaxInformation[ lineIntegrate] = {"LocalVariables" -> {"Plot", {3, 3}}, "ArgumentsPattern" -> {_, _, _}}; lineIntegrate[r_?VectorQ, f_Function, {t_, tMin_, tMax_}] := Module[{param, localR}, localR = r /. t -> param; Integrate...