Jump to content

Runtime evaluation/In an environment: Difference between revisions

m
→‎{{header|Metafont}}: modified to resemble to other examples
m (→‎{{header|Octave}}: modified to resemble to other examples)
m (→‎{{header|Metafont}}: modified to resemble to other examples)
Line 84:
=={{header|Metafont}}==
 
<lang metafont>vardef evalit(expr s, vva, vb) =
save x,a,b; x := vva; a := scantokens s;
x := vb; b := scantokens s; a-b
enddef;
 
a := show(evalit("2x+1", 5, 3));
b := evalit("2x+1", 2);
show (a-b);
end</lang>
 
Cookies help us deliver our services. By using our services, you agree to our use of cookies.