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.


evalx(prog, a, b)
Func
  Local x,eresult1,eresult2
  a→x
  expr(prog)→eresult1
  b→x
  expr(prog)→eresult2
  Return eresult2-eresult1
EndFunc
 
■ evalx("ℯ^x", 0., 1)
                      1.71828