Runtime evaluation: Difference between revisions

→‎[[Eval#ALGOL 68]]: possible in the ALGOL 68G interpretor.
(→‎[[Eval#ALGOL 68]]: possible in the ALGOL 68G interpretor.)
Line 5:
For a more restricted task, see [[Eval in environment]].
 
=={{header|ALGOL 68}}==
<!-- {{does not work with|ALGOL 68|Standard - variable names are not visible at run time with classic compilers.}} -->
{{works with|ALGOL 68G|Any - tested with release mk15-0.8b.fc9.i386 - this implementation is an interpretor, and ''evaluate'' is an extension to the standard}}
 
<!-- {{does not work with|ELLA ALGOL 68|Any This implementation is a compiler}} -->
Variable names are generally not visible at run time with classic compilers. However '''ALGOL 68G''' is an interpretor and it retains this ability.
<lang algol>print(evaluate("4.0*arctan(1.0)"))</lang>
Output:
<pre>
+3.14159265358979e +0
</pre>
=={{header|Common Lisp}}==
 
Line 28 ⟶ 39:
<lang lisp>(let ((x 1))
(eval `(+ x 1))) ; this will fail unless x is a special variable or has a dynamic binding</lang>
 
 
=={{header|Groovy}}==