[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
defining functions on-the-fly
- Subject: defining functions on-the-fly
- From: mperrin+news(at)arkham.berkeley.edu (Marshall Perrin)
- Date: 22 May 2001 22:30:22 GMT
- Newsgroups: comp.lang.idl-pvwave
- Organization: University of California at Berkeley
- User-Agent: slrn/0.9.6.3 (SunOS)
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:25050
I would like to be able to define some functions on-the-fly in IDL.
In other words, my program does some stuff, and computes that the desired
function is (some arbitrary function, not necessarily a polynomial).
I would then like to define the equivalent of
FUNCTION myfunction, x,y
return, <my arbitrary expression in (x,y)>
and then be able to call myfunction(x,y).
Is there any easier way to do this than actually writing out a
myfunction.pro file to disk and compiling that? That way would certainly
work, but it strikes me as inelegant... At first I thought I could do this
with the EXECUTE statement, but you can't define functions using that.