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

2023-07-01 11:58:00 -04: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))