RosettaCodeData/Task/Runtime-evaluation-In-an-environment/Ring/runtime-evaluation-in-an-environment.ring

8 lines
194 B
Text
Raw Permalink Normal View History

2016-12-05 23:44:36 +01:00
expression = "return pow(x,2) - 7"
one = evalwithx(expression, 1.2)
two = evalwithx(expression, 3.4)
see "one = " + one + nl + "two = " + two + nl
func evalwithx expr, x
return eval(expr)