Quote:
Hello,
Here is how things work internally:
In Numeric mode, MOST functions are case insensitive, but use an uppercase display.
the parser distinguished between fully qualified names (My_Program.MyVariables) and non fully qualified ones (FOO)
The order of priority in name resolution for a non fully qualified name is:
1) Localy known program names (functions or vars)
2) Build in functions and variables (some beeing case insensitive)
3) Current app functions and vars
4) global program exported functions and vars
5) all standard app non forced fully qualified functions/vars (F1 for example. as you no doubd have discovered, you can call F1 even if function is not the current app. this is why)
6) user variables (the ones that get created when you do abc:=1)
7) CAS (functions and variables)
Having CAS here as number 7 is usefull, in the same way than allowing use of F1 even if function is not the current app is useful... However, it is dangerous (mostly for power users) as it can lead to strange results when used in non trivial cases, or can lead to confusion, or can be overriten...
If you want to use a CAS command, the best is to fully qualify it by doing: CAS.functionName(params)...
note, that most Numerical functions will evaluate all their parameters before they are called.
when calling a CAS function from the numerical world, the parameters will be transformed into a cas object (unevaluated) so that the CAS gets to decide what to do with them. However, it means that these objects need to be valid numerical mode objects...
If you want to call a cas function from numerical and the parameters are not valid in numerical mode (such as a undefined variables or a symbolic matrice), you need to use CAS.function("input") the string input will be parsed by the CAS and not the numerical mode and the CAS rules will apply to it.
As a general rule, the CAS has access to all the numerical mode functions/variables, with the exceptions of local variables... As a result, and as an exception to the rule above, local variables in CAS functions arguements get replaced by their values before the CAS is called...
so, here you are, the long story about how these work with each others!
cyrille
This is _extremely_ useful information and I think will likely eliminate a good number of questions from programmers. Thank you for giving us insight on how the internals work.