| Both sides previous revision
Previous revision
Next revision
|
Previous revision
|
manual:chapter6:operators:cmd_ovr_eval [2019/10/28 17:12] jojo1973 Rephrased description |
manual:chapter6:operators:cmd_ovr_eval [2019/11/17 08:23] (current) jojo1973 Highlighted EVAL when used in technical sense |
| ---- | ---- |
| ^ __Input Stack__ ^ ^ __Output Stack__ ^^^ | ^ __Input Stack__ ^ ^ __Output Stack__ ^^^ |
| | **O<sub>1</sub>** | **→** | //see list under __Description__// ||| | | **O** | **→** | //see list under __Description__// ||| |
| | //Level 1// | //→// | //Level n// | //...// | //Level 1// | | | //Level 1// | //→// | //Level n// | //...// | //Level 1// | |
| |
| * **Local Name**: ''EVAL'' //recalls// the content of the variable. | * **Local Name**: ''EVAL'' //recalls// the content of the variable. |
| * **Global Name**: ''EVAL'' //calls// the content of a variable: | * **Global Name**: ''EVAL'' //calls// the content of a variable: |
| - a __Name__ is evaluated; | - a __Name__ is ''EVAL''uated; |
| - a __Program__ is evaluated; | - a __Program__ is ''EVAL''uated; |
| - a __Directory__ becomes the current directory; | - a __Directory__ becomes the current directory; |
| - __other objects__ which are not lists are put on the stack. | - __other objects__ which are not lists are put on the stack. |
| * **Program**: ''EVAL'' //enters// each object in the program: | * **Program**: ''EVAL'' //enters// each object in the program: |
| - an [[manual:chapter6:dirs:cmd_unquoteid|unquoted]] __Name__ is evaluated; | - an [[manual:chapter6:dirs:cmd_unquoteid|unquoted]] __Name__ is ''EVAL''uated; |
| - a __Keyword__ is ''[[manual:chapter6:operators:cmd_ovr_xeq|XEQ]]''ted; | - a __Keyword__ is ''[[manual:chapter6:operators:cmd_ovr_xeq|XEQ]]''ted; |
| - __other objects__ which are not lists are put on the stack. | - __other objects__ which are not lists are put on the stack. |
| * **Symbolic expression**: ''EVAL'' //enters// each object in the expression: | * **Symbolic expression**: ''EVAL'' //enters// each object in the expression: |
| - a __Name__ is evaluated; | - a __Name__ is ''EVAL''uated; |
| - a __Keyword__ is ''[[manual:chapter6:operators:cmd_ovr_xeq|XEQ]]''ted; | - a __Keyword__ is ''[[manual:chapter6:operators:cmd_ovr_xeq|XEQ]]''ted; |
| - __other objects__ which are not lists are put on the stack. | - __other objects__ which are not lists are put on the stack. |
| * **Other objects**: if they are not lists ''EVAL'' puts them on the stack. | * **Other objects**: if they are not lists ''EVAL'' puts them on the stack. |
| * **List**: ''EVAL'' //enters// each object in the list: | * **List**: ''EVAL'' //enters// each object in the list: |
| - __any object__ is evaluated according above mentioned rules. | - __any object__ is ''EVAL''uated according above mentioned rules. |
| | |
| As a final step, ''EVAL'' will perform numerical simplification according to the status of flags from [[manual:appendix:flags#flag-70|-70]] to [[manual:appendix:flags#flag-78|-78]]. | As a final step, ''EVAL'' will perform numerical simplification according to the status of flags from [[manual:appendix:flags#flag-70|-70]] to [[manual:appendix:flags#flag-78|-78]]. |
| |
| * In userRPL, if the argument is a list ''EVAL'' //enters// any object in the list, then: | * In userRPL, if the argument is a list ''EVAL'' //enters// any object in the list, then: |
| - a __Name__ is evaluated; | - a __Name__ is ''EVAL''uated; |
| - a __Program__ is evaluated; | - a __Program__ is ''EVAL''uated; |
| - a __Keyword__ is ''[[manual:chapter6:operators:cmd_ovr_xeq|XEQ]]''ted; | - a __Keyword__ is ''[[manual:chapter6:operators:cmd_ovr_xeq|XEQ]]''ted; |
| - __other objects__ are put on the stack. | - __other objects__ are put on the stack. |
| </code> | </code> |
| will perform the following steps: | will perform the following steps: |
| - ''CIRCUM'' (a //global name//) is evaluated; | - ''CIRCUM'' (a //global name//) is ''EVAL''uated; |
| - ''« TWOPI * »'' (a //program//) is evaluated; | - ''« TWOPI * »'' (a //program//) is ''EVAL''uated; |
| - ''TWOPI'', the first object (a //global name//) in the program is evaluated; | - ''TWOPI'', the first object (a //global name//) in the program is ''EVAL''uated; |
| - ''6.28'' (a //real number//) is put on the stack; | - ''6.28'' (a //real number//) is put on the stack; |
| - ''[[manual:chapter6:operators:cmd_ovr_mul|*]]'', the second object (a //keyword//) in the program is ''[[manual:chapter6:operators:cmd_ovr_xeq|XEQ]]''ted. | - ''[[manual:chapter6:operators:cmd_ovr_mul|*]]'', the second object (a //keyword//) in the program is ''[[manual:chapter6:operators:cmd_ovr_xeq|XEQ]]''ted. |
| </code> | </code> |
| will perform the following steps: | will perform the following steps: |
| - ''%%'16'%%'' (a //symbolic expression//) is evaluated; | - ''%%'16'%%'' (a //symbolic expression//) is ''EVAL''uated; |
| - ''16'' (a //real number//) is put on the stack; | - ''16'' (a //real number//) is put on the stack; |
| - ''[[manual:chapter6:transcendentals:cmd_sqrt|√]]'' (a //keyword//) is ''[[manual:chapter6:operators:cmd_ovr_xeq|XEQ]]''ted. | - ''[[manual:chapter6:transcendentals:cmd_sqrt|√]]'' (a //keyword//) is ''[[manual:chapter6:operators:cmd_ovr_xeq|XEQ]]''ted. |