I have several functions in my program that look like this:

void foo(int x, int y)


Now I want my program to take a string that looks like:

foo(3, 5)


And execute the corresponding function. What's the most straightforward way to implement this?

When I say straightforward, I mean reasonably extensible and elegant, but it shouldn't take too long to code up.

Edit:

While using a real scripting language would of course solve my problem, I'd still like to know if there is a quick way to implement this in pure C++.


Question: What do I do wrong to get hip aches after biking?
Answer: The web site Bike Dynamics has an online guide that could help you find the right fit. To me it sounds like you're going hard. If the thigh is swelling raising the seat could make it worse. Lowering the seat would affect knees so you need to find exact spot. You may also want to look at a roller for your Iliotibial Band, you could develop chronic ITBS if your bike fit remains poor.