Runtime evaluation: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) (Rename Perl 6 -> Raku, alphabetize, minor clean-up) |
Thundergnat (talk | contribs) m (Fix Perl 6 -> Raku in comments) |
||
Line 1,395: | Line 1,395: | ||
my ($a, $b) = (-5, 7); |
my ($a, $b) = (-5, 7); |
||
my $ans = EVAL 'abs($a * $b)'; # => 35</lang> |
my $ans = EVAL 'abs($a * $b)'; # => 35</lang> |
||
Unlike in Perl 5, <tt>eval</tt> in |
Unlike in Perl 5, <tt>eval</tt> in Raku only compiles and executes the string, but does not trap exceptions. You must say <tt>try eval</tt> to get that behavior (or supply a <tt>CATCH</tt> block within the text to be evaluated). |
||
=={{header|REBOL}}== |
=={{header|REBOL}}== |