manual:chapter6:operators:cmd_ovr_eval

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
manual:chapter6:operators:cmd_ovr_eval [2019/10/27 17:17]
jojo1973 created
manual:chapter6:operators:cmd_ovr_eval [2019/11/17 08:23] (current)
jojo1973 Highlighted EVAL when used in technical sense
Line 9: Line 9:
 ---- ----
 ^  __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//  | 
  
Line 16: Line 16:
 |**Type**| [[manual:chapter5:basics#operators|Operator]]  || |**Type**| [[manual:chapter5:basics#operators|Operator]]  ||
 |**Parallel list processing**| //Yes, but specific group is determined by the object being evaluated//  ||  |**Parallel list processing**| //Yes, but specific group is determined by the object being evaluated//  || 
-|**Affected by flags**| [[manual:appendix:flags#flag-70|-70]] | Global autosimplification rules  | +|**Affected by flags**|  [[manual:appendix:flags#flag-70|-70]] | Global autosimplification rules  | 
-|:::| [[manual:appendix:flags#flag-71|-71]] | Application of **Group 1** autosimplification rules  | +|:::|  [[manual:appendix:flags#flag-71|-71]] | Application of **Group 1** autosimplification rules  | 
-|:::| [[manual:appendix:flags#flag-72|-72]] | Application of **Group 2** autosimplification rules  | +|:::|  [[manual:appendix:flags#flag-72|-72]] | Application of **Group 2** autosimplification rules  | 
-|:::| [[manual:appendix:flags#flag-73|-73]] | Application of **Group 3** autosimplification rules  | +|:::|  [[manual:appendix:flags#flag-73|-73]] | Application of **Group 3** autosimplification rules  | 
-|:::| [[manual:appendix:flags#flag-74|-74]] | Application of **Group 4** autosimplification rules  | +|:::|  [[manual:appendix:flags#flag-74|-74]] | Application of **Group 4** autosimplification rules  | 
-|:::| [[manual:appendix:flags#flag-75|-75]] | Application of **Group 5** autosimplification rules  | +|:::|  [[manual:appendix:flags#flag-75|-75]] | Application of **Group 5** autosimplification rules  | 
-|:::| [[manual:appendix:flags#flag-76|-76]] | Application of **Group 6** autosimplification rules  | +|:::|  [[manual:appendix:flags#flag-76|-76]] | Application of **Group 6** autosimplification rules  | 
-|:::| [[manual:appendix:flags#flag-77|-77]] | Application of **Group 7** autosimplification rules  | +|:::|  [[manual:appendix:flags#flag-77|-77]] | Application of **Group 7** autosimplification rules  | 
-|:::| [[manual:appendix:flags#flag-78|-78]] | Application of **Group 8** autosimplification rules  |+|:::|  [[manual:appendix:flags#flag-78|-78]] | Application of **Group 8** autosimplification rules  | 
 +|:::|  [[manual:appendix:flags#flag-103|-103]] | Complex results  |
 </callout> </callout>
  
 <callout color="orangered" icon="fa fa-comment" title="Description"> <callout color="orangered" icon="fa fa-comment" title="Description">
 ---- ----
-The ''EVAL'' command evaluates the object on the top level of the stack. Evaluation occurs recursively i.e. objects contained in the argument are evaluated too, and so on.+The ''EVAL'' command evaluates the object on the top level of the stack. Evaluation occurs //recursively//.
  
-The effect of the evaluation and the resulting output depends on the type of object being evaluated, as summarized by the following table.+The effect of the evaluation and the resulting output depends on the type of object being evaluated, as summarized by the following list.
  
-  * **Local Name**: //Recalls// the content of the variable. +  * **Local Name**: ''EVAL'' //recalls// the content of the variable. 
-  * **Global Name**: //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**: //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**: //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 they are put on the stack. +  * **Other objects**: if they are not lists ''EVAL'' puts them on the stack. 
-  * **List**: //Enters// each object in the list:+  * **List**: ''EVAL'' //enters// each object in the list:
     - __any object__ is ''EVAL''uated according above mentioned rules.     - __any object__ is ''EVAL''uated according above mentioned rules.
          
Line 61: Line 62:
  
   * 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.
Line 87: Line 88:
 then the command then the command
 <code> <code>
-1:                             2+2:                             2 
 +1:                      'CIRCUM'
 …………………………………………………………………………………… ……………………………………………………………………………………
-CIRCUM+EVAL
 </code> </code>
 will perform the following steps: will perform the following steps:
Line 96: Line 98:
   - ''TWOPI'', the first object (a //global name//) in the program is ''EVAL''uated;   - ''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;
-  - ''*'' (a //keyword//) 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.
  
-resulting in+Resulting in
 <code> <code>
 1:                         12.56 1:                         12.56
 +……………………………………………………………………………………
 +
 +</code>
 +----
 +The command
 +<code>
 +1:                    { '16' √ }
 +……………………………………………………………………………………
 +EVAL
 +</code>
 +will perform the following steps:
 +  - ''%%'16'%%'' (a //symbolic expression//) is ''EVAL''uated;
 +  - ''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.
 +
 +Resulting in
 +<code>
 +1:                        { 4. }
 …………………………………………………………………………………… ……………………………………………………………………………………
  
  • manual/chapter6/operators/cmd_ovr_eval.1572221866.txt.gz
  • Last modified: 2019/10/27 17:17
  • by jojo1973