Runtime evaluation/In an environment: Difference between revisions
Content added Content deleted
(→{{header|Octave}}: ++ metafont) |
(clarify task: mention not using a global variable, avoid the 'provided code is a function' interpretation) |
||
Line 1:
{{task}} Given a program in the language
Do so in a way which:
* does not involve string manipulation of source code
* 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.
For more general examples and language-specific details, see [[Eval]].
Line 79 ⟶ 83:
=={{header|Metafont}}==
{{incorrect|Metafont|Either do not use a global variable, or note that this is impossible.}}
<lang metafont>string p;
p := "2x + 1";
Line 89 ⟶ 96:
=={{header|Octave}}==
{{incorrect|Octave|Either do not use a global variable, or note that this is impossible.}}
<lang octave>p = "x .* 2";
Line 112 ⟶ 121:
=={{header|PHP}}==
{{incorrect|PHP|Either do not use a global variable, or note that this is impossible.}}
<lang php><?php
Line 166 ⟶ 177:
=={{header|Tcl}}==
{{incorrect|Tcl|The code provided should not itself be a function, but have x as a free variable.}}
<lang tcl>package require Tcl 8.5
|