Do you have any ideas of how to call a function, such as Sin(x), by providing the string "sin" and the double x?

Something like:

lRet = CallFunctionByName("sin", x)

I'm working on a program that parses functions and evaluates them, and this would make life quite a bit easier if such a thing existed. I have found CallByName, which I could possibly manipulate into doing the above, but it would be a pain (and bad code too). Any help would be appreciated.