I think that if you're going to use muParserSSE for the maths (and it seems the right choice) should add a EvalString trigger for your string variables so there is "single responsability" for the functions.
You can setup this trigger based on printf ⁻ without the variable number of arguments, so you'd need to use assign as a replacement for those.
EvalString("@1, @1 and @2")
All the variables used in those would be assumed to be strings so could even be referenced by another symbol (and have a different "variable array") - unsure if it needs position since it there is only one string allowed in triggers?
If you want to use a number here from something that is naturally parsed as a int (say a e[3+5] on a assign), using the STR mode on the assign will try to convert to string and put it the string pool.
0x411A Assign(S:Statement*,I:Type*ArgType,I:Local*) 0x411B Eval(S:Expression*, /*maybe I:Type*ArgType */,I;Loc*) 0x411C EvalString(S:String* /*maybe I;Loc* */)
Leave the Eval only for int and math expressions. You can use them with strings anyway with e[] on the assignment, if STR Mode on Assign will try to convert to string.
Isn't it better?
No longer needed with the other scheme above, just straightforward string expansion. For the int expressions, sure, but that would happen anyway.If you want Eval("something", y), where y is the argument number from the trigger to replace, and "something" is a string type:
-First, the library must parse the "something"
Yes-Second, I have to search ahead
-Third, I need to check if the argument exists
...
-Finally, if type is valid, I will modify the value
Table of TRIGGER.IDS names and arguments types built at startup?-Fourth, I need to parse the trigger construction to check type
Edited by i30817, 02 May 2012 - 04:32 AM.