Re: mathematical function parser/compiler

Robert Bernecky <>
7 May 1998 16:53:26 -0400

          From comp.compilers

Related articles
mathematical function parser/compiler (Jens Dreger) (1998-05-04)
Re: mathematical function parser/compiler (Robert Bernecky) (1998-05-07)
Re: mathematical function parser/compiler (Joerg Schoen) (1998-05-07)
Re: mathematical function parser/compiler (Ram Bhamidipaty) (1998-05-12)
| List of all articles for this month |

From: Robert Bernecky <>
Newsgroups: comp.compilers
Date: 7 May 1998 16:53:26 -0400
Organization: ICAN.Net Customer
References: 98-05-021
Keywords: parse, interpreter

Jens Dreger wrote:
> I'm looking for a c/c++ function, that takes some string like
> f(x)=1/(1+x^2)
> at runtime (!) and returns a function that evaluates this
> expression when called within the program. This sounds like a
> common problem, so I assume it has already been solved, but I
> couldn't find anything like that.

You might try calling a J interpreter DLL if you're in windoze (not sure
how their linux version works). J is an offshoot of APL
that has some very nice array handling facilities in it.
In J, you could write something along the lines of:
      f=. 1 % 1+ y. ^2 NB. y. is the argument

then do:
      f 10 20 40...
and execute foo on a whole array (not necessarily just a vector)
at once.

Look at


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.