MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

[JLINK] passing a function reference

  • To: mathgroup at smc.vnet.net
  • Subject: [mg62832] [JLINK] passing a function reference
  • From: jkatz at email.arizona.edu
  • Date: Tue, 6 Dec 2005 00:04:46 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Frequently when writing program in mathematica, I find it useful to have one
function take function as one of its parameters, e.g. F[f_]:=f[2]
I would like to duplicate this functionality for some installable java code I am
writing so that class`F[f] passes some reference to java so that I can evaluate
the function on the java side, calling back to mathematica appropriately, so it
seems like I can either pass a symbol represting the function name, build up a
packet manually to evaluate it and send that off, or possibly pass a pure
function and do something similar, what seems like a robust solution to you,
I'd (ideally) like this to be as transparent to the end user as possible, and
to incoporate any optimization (MethodFunction for example), thats probably
asking alot, but I'm just interested to hearing what you think is a good
overall solution


  Jonathan Katz


  • Prev by Date: Re: Threading 'Append'
  • Next by Date: Re: Types in Mathematica thread
  • Previous by thread: Re: Can you solve my gravity-maths problem in Mathematica?
  • Next by thread: Zero or one