Runtime evaluation/In an environment: Difference between revisions

m
added whitespace.
(→‎{{header|REXX}}: re-wrote code to not use a global variable.)
m (added whitespace.)
Line 1:
{{task}} Given a program in the language (as a string or AST) with a free variable named <var>x</var> (or another name if that is not valid syntax), evaluate it with <var>x</var> bound to a provided value, then evaluate it again with <var>x</var> bound to another provided value, then subtract the result of the first from the second and return or print it.
 
 
Do so in a way which:
Line 5 ⟶ 6:
* is plausibly extensible to a runtime-chosen set of bindings rather than just <var>x</var>
* does not make <var>x</var> a ''global'' variable
 
 
or note that these are impossible.
 
 
===See also===
* For more general examples and language-specific details, see [[Eval]].
* [[Dynamic variable names]] is a similar task.
<br><br>
 
=={{header|ALGOL 68}}==