x
x
x


Do so in a way which:

 does not involve string manipulation of the input source code
 is plausibly extensible to a runtime-chosen set of bindings rather than just x
 does not make x 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.


/*REXX program demonstrates a run─time evaluation of an expression (entered at run─time)*/
say '──────── enter the 1st expression to be evaluated:'
 
parse pull x                                     /*obtain an expression from the console*/
y.1= x                                           /*save the provided expression for  X. */
say
 
say '──────── enter the 2nd expression to be evaluated:'
 
parse pull x                                     /*obtain an expression from the console*/
y.2= x                                           /*save the provided expression for  X. */
 
say
say '────────  1st expression entered is: '  y.1
say '────────  2nd expression entered is: '  y.2
say
 
interpret 'say "──────── value of the difference is: "' y.2  "-"  '('y.1")"  /* ◄─────┐ */
                                                                             /*       │ */
                                                                             /*       │ */
                                                 /*subtract 1st exp. from the 2nd──►──┘ */
 
drop x                                           /*X var. is no longer a global variable*/
exit 0                                           /*stick a fork in it,  we're all done. */