RosettaCodeData/Task/Runtime-evaluation-In-an-environment/Ring/runtime-evaluation-in-an-environment.ring
2023-07-01 13:44:08 -04:00

7 lines
194 B
Text

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)