RosettaCodeData/Task/Runtime-evaluation-In-an-environment/ALGOL-68/runtime-evaluation-in-an-environment.alg

4 lines
154 B
Text
Raw Permalink Normal View History

2013-04-10 23:57:08 -07:00
PROC eval_with_x = (STRING code, INT a, b)STRING:
(INT x=a; evaluate(code) ) + (INT x=b; evaluate(code));
print((eval_with_x("2 ** x", 3, 5), new line))