Runtime evaluation/In an environment: Difference between revisions

m
→‎{{header|Perl 6}}: EVAL must be allowed
m (→‎{{header|TXR}}: lang tag: txr -> txrlisp)
m (→‎{{header|Perl 6}}: EVAL must be allowed)
Line 600:
 
=={{header|Perl 6}}==
{{Works with|rakudo|2015-12-22}}
 
For security, you must explicitly allow use of 'EVAL'.
<lang perl6>sub eval_with_x($code, *@x) { [R-] @x.map: -> \x { eval $code } }
<lang perl6>use MONKEY-SEE-NO-EVAL;
<lang perl6>sub eval_with_x($code, *@x) { [R-] @x.map: -> \x { evalEVAL $code } }
 
say eval_with_x('3 * x', 5, 10); # Says "15".
say eval_with_x('3 * x', 5, 10, 50); # Says "135105".</lang>
 
=={{header|PHP}}==
2,392

edits