On Mon, 20 Aug 2001, Pearu Peterson wrote:
What do you think? Can I can implement/test these modifications and send you them as a patch?
Meanwhile I implemented these hooks, and it works perfectly. Please find the patch attached to this message. To apply it, 'cd ginac/' and hit 'patch -p0 < function.pl.diff-0.9.3'. As a result, I can now construct GiNaC functions directly in Python. Here is an example of the corresponding Python session: import ginac class mysin: nparams = 1 def eval(self, x): return self(x, hold=1) def derivative(self, x, diff_param): return ginac.cos(x) f = ginac.build_function(mysin) x = ginac.symbol('x') print f(x) # outputs: mysin(x) print f(x).diff(x) # outputs: cos(x) I hope that you find my patch useful for creating interfaces between GiNaC and various scripting languages. Regards, Pearu