MathGroup Archive 2003

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

Search the Archive

package functions in mathlink

  • To: mathgroup at
  • Subject: [mg43571] package functions in mathlink
  • From: theoryboy at (Peter Saffrey)
  • Date: Sun, 21 Sep 2003 05:42:12 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

I have defined a package which I would then like to interact with via
mathlink. The relevant part of the package simply looks like this:

simpfun[x_, y_] := x - y

I open the package by using 

MLPutFunction(link, "EnterTextPacket", 1);
MLPutString(link, "<</home/pzs/workspace/mathematica/testpackage.m");

and then call it using

MLPutFunction(link, "EvaluatePacket", 1);
MLPutFunction(link, "simpfun", 2);
MLPutInteger(link, 4);
MLPutInteger(link, 2);

But rather than getting back an integer answer, I am returned an
expression that contains the complete function call. I feel sure I
must be using the wrong packet passing function, but EvaluatePacket
seems appropriate. What am I doing wrong?


  • Prev by Date: Re: why do recursive function calculations take so long in Mathematica?
  • Next by Date: Re: Nonlinear regression
  • Previous by thread: Evaluation semantics have changed
  • Next by thread: Re: package functions in mathlink