MathGroup Archive 1996

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

Search the Archive

MathLink Q: Not working anymore!!


Hi. I am working on Math to C converter.
I put 

:Evaluate:	Attributes[M2C] = {HoldAll}

in my .tm file to get the whole expression availble in calling C function.
It used to work.  But after I lost my .tm file, and recode it, it doesn't work 
any more.
I have to use explicit Hold[] for argument to prevent evaluating.

The following is my .tm file

----------------
:Evaluate:	BeginPackage["ConvertPackage`"]
:Evaluate:	M2C::usage = 
		"M2C[exp] will convert given mathematica an expression or    
		a compound expression into a correspoding C program"
:Evaluate:	Begin["Private`"]
:Begin:
:Function:	m2c
:Pattern:	M2C[exp_]
:Arguments:	{exp}
:ArgumentTypes:	{Manual}
:ReturnType:	Manual
:End:
:Evaluate:	Attributes[M2C] = {HoldAll}
:Evaluate:	End[ ]
:Evaluate:	EndPackage[ ]
-----------

Now I have to do M2C[Hold[ ]] instead of M2C[ ].

I also try to set attribute in MAthematica session after I install C function,
but it doesn't work either.

??M2C says

----------------
M2C[exp] will convert given mathematica an expression or    
     a compound expression into a correspoding C program

Attributes[M2C] = {HoldAll}
 
M2C[exp_] := 
  ExternalCall[LinkObject["m2c", 2, 2], 
   CallPacket[0, {exp}]]

-----------------

Putting the Evalauate line in different line doesn't make any difference.
Can anybody help?

---
Chang Song (song at cs.purdue.edu)


  • Prev by Date: MathLink Q: Not working anymore!!
  • Next by Date: Re: Emacs Mathematica mode
  • Previous by thread: MathLink Q: Not working anymore!!
  • Next by thread: Re: MathLink Q: Not working anymore!!