Runtime evaluation/In an environment: Difference between revisions
Runtime evaluation/In an environment (view source)
Revision as of 14:09, 22 December 2015
, 8 years ago→{{header|Perl 6}}: EVAL must be allowed
m (→{{header|TXR}}: lang tag: txr -> txrlisp) |
SqrtNegInf (talk | contribs) 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;
say eval_with_x('3 * x', 5, 10); # Says "15".
say eval_with_x('3 * x', 5, 10, 50); # Says "
=={{header|PHP}}==
|