by joe_blaze » July 24th, 2015, 1:43 am
Hi Ajay,
Here is additional information about the execution of Statement #2.
Statement #2: ⎕cse 'GetValue' 'string.Format({0},{1})' "WWWE {0}" "123,8999"
Step #1: The CSE parses the programmer-provided C# executable statement, i.e. 'string.Format({0},{1}' and determines that there are substitution placeholders in the executable statement string and there are available APL+Win values available to substitute, i.e. "WWWE {0}" and "123,8999". This means that prior to submitting the executable statement to the C# complier, the CSE will perform the substitutions of APL+Win values into the executable statement string.
Step #2: The CSE performs the substitutions into the thusfar-unexecuted, executable statement so that the executable statement is now 'string.Format("WWWE {0}","123,8999")'.
Step #3: The CSE now submits the executable statement, i.e. 'string.Format("WWWE {0}","123,8999")' to the C# compiler.
Step #4: The C# compiler executes the executable statement resulting in "WWWE 123,8999".
The important point here is that to the CSE 'string.Format({0},{1})' is treated as any other text string with respect to the CSE string value substitution technology. Only after the CSE has performed the programmer-requested string value substitution, is that 'substituted' text string submitted to the C# compiler for execution. In all cases the CSE does not parse the programmer-provided executable statement in the manner of C# to try and determine how C# would compile and execute the statement, because to do so the CSE would have to duplicate all of C# and that is not practical or desirable.
As designed and documented, the CSE string value substitution is performing the substitutions on the executable statement before the CSE requests its execution by the C# compiler.