i'm developing a math/statistical software. I would like that my customer can write something like :
Function1(value)
Then, depending on the name of the function, call my internal software function. This seems a 'parser' right?
At the moment i'm thinking to solve it with a code like this:
switch(my_parsed_function_string) {
case "function1":
result = function1(value);
case "function2":
result = function2(value);
...
...
}
Is there a more elegant way ? A way where a string contained the 'function' name can be lunched without extra developer work ?
Thank you in advance