Runtime evaluation/In an environment: Difference between revisions
Content added Content deleted
Line 1,372: | Line 1,372: | ||
There are no facilities for control over the environment; expr() evaluates in the same environment as the caller, including local variables. [Someone please verify this statement.] [[Category:TI-89 BASIC examples needing attention]] |
There are no facilities for control over the environment; expr() evaluates in the same environment as the caller, including local variables. [Someone please verify this statement.] [[Category:TI-89 BASIC examples needing attention]] |
||
=={{header|Transd}}== |
|||
The <code>(eval)</code> function returns a pair, where the first element is boolean flag indicating success of running the code, and the second element is a string containing the output of code execution. |
|||
<lang Scheme>#lang transd |
|||
MainModule: { |
|||
code: "(+ 5 x)", |
|||
_start: (lambda (textout |
|||
(- (to-Int (with x 100 (snd (eval code)))) |
|||
(to-Int (with x 1 (snd (eval code))))) |
|||
)) |
|||
}</lang> |
|||
{{out}} |
|||
<pre> |
|||
99 |
|||
</pre> |
|||
=={{header|TXR}}== |
=={{header|TXR}}== |