Evaluation of variables in 50g
|
05-21-2014, 01:30 PM
Post: #4
|
|||
|
|||
RE: Evaluation of variables in 50g
I found the answer in the EVAL section of the AUR:
Evaluating a global name causes the following effects: Quote:Calls the contents of the variable: So the statement Quote:... the object stored in the corresponding variable is itself evaluated. is not accurate. Only names, programs and directories are evaluated. I wonder why this specific behavior. Why not EVAL everything? Most objects would push themselves on the stack anyway, and if you don't want it EVAL'd just use 'VAR' RCL instead of VAR. It would be more consistent to have one behavior for all object types. For example, the function y=x, and y=k*x, written as: Code:
Code:
Even if we define k=1, then y will return the value of x in one case, or the algebraic 'k*x' in the other. Only if 'x' is undefined it works consistently. But changing this would wreck most existing code, so I guess we have some thinking to do before making a decision. Claudio |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)