Jump to content

Runtime evaluation/In an environment: Difference between revisions

m
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
Line 205:
 
=={{header|Elena}}==
Using ELENA Script engine (3.35.0):
<lang elena>import extensions.
import extensions'scripting.
 
Using VM console client:
program =
<lang elena>import extensions.;
[
import extensions'scripting.;
var program := escript eval("^{ eval(x)[ ^" + 'program'arguments[1] + " ] }").
 
programpublic =program()
{
var text := program_arguments[1];
var arg := program_arguments[2];
var program := lscript.interpret(text);
console printLine('program'arguments[1],",",'program'arguments[2]," = ", program eval('program'arguments[2] toReal)).
console.printLine(
].</lang>
text,",",arg," = ",program.eval(arg.toReal()));
].}</lang>
{{out}}
<pre>
eval.exe "{ eval(x) { ^extensions'math'mathControl power(x,2); }}" 2
ELENA VM 35.30.14 (C)2005-20172020 by Alex Rakov
Initializing...
Debug mode...
Done...
{ eval(x) { ^extensions'math'mathControl power(x,2); }},2 = 4.0
</pre>
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.