Rakudo: `Cool.EVAL` does not check for the MONKEY-SEE-NO-EVAL pragma

Created on 31 Aug 2020  路  3Comments  路  Source: rakudo/rakudo

The Problem

The following code works:

say "$a + 1".EVAL  # OUTPUT: 芦2禄;

Expected Behavior

I expected that using the method form of EVAL would throw the same error as the subroutine form of EVAL

Actual Behavior

The method form of EVAL does not throw an error, even when used without the MONKEY-SEE-NO-EVAL

Note

If this behavior not a bug, please let me know so that I can close this issue and open a raku/docs issue. If this behavior is intended and/or a known bug, we should note it in Cool.EVAL docs.

All 3 comments

I expected that using the method form of EVAL would throw the same error as the subroutine form of EVAL

raku -e 'my $a = 0; say &EVAL("$a + 1")'
1

which is just to say there are probably more cases where the pragma doesn't work than where it does.

AFAIK, this behaviour is intentional.

AFAIK, this behavior is intentional.

Any references for that? It feels a bit more like an oversight to me. (As an aside: I'm not really a fan of the method form of EVAL.)

Was this page helpful?
0 / 5 - 0 ratings