Permalink
Browse files

rename sub and method `eval` to `EVAL`

  • Loading branch information...
FROGGS committed Jan 1, 2014
1 parent 17d73e4 commit 48a8de321378f4c9447831bdc691615096473f0d
@@ -19,7 +19,7 @@ have at least one dll.
=item *
-It is not possible to use C<eval> or similar functionality with a precompiled
+It is not possible to use C<EVAL> or similar functionality with a precompiled
program.
=head1 METHOD
View
@@ -1,11 +1,11 @@
-eval(q:to/PERL5/,:lang<perl5>);
+EVAL(q:to/PERL5/,:lang<perl5>);
print "Hel"."lo ";
PERL5
-eval(q:to/PERL5/,:lang<perl5>);
+EVAL(q:to/PERL5/,:lang<perl5>);
print "World\n";
PERL5
-eval(q:to/PERL5/,:lang<perl5>);
+EVAL(q:to/PERL5/,:lang<perl5>);
use strict;
use warnings;
package Foo;
@@ -18,9 +18,9 @@ sub new {
bless {},"Foo";
}
PERL5
-my $foo = eval(:lang<perl5>,'Foo->new');
+my $foo = EVAL(:lang<perl5>,'Foo->new');
say $foo.baz("Perl hacker");
-say eval(:lang<perl5>,"125");
-say eval(:lang<perl5>,"13.5");
-say eval(:lang<perl5>,"'Hello there'");
+say EVAL(:lang<perl5>,"125");
+say EVAL(:lang<perl5>,"13.5");
+say EVAL(:lang<perl5>,"'Hello there'");
View
@@ -2080,7 +2080,7 @@ public partial class Builtins {
if (th.info.setting.upcall_receiver == null)
return Kernel.Die(th, "Cannot eval; no compiler available");
SubInfo outer = th.caller.info;
- object r = UpCall(th.info.setting, "eval",
+ object r = UpCall(th.info.setting, "EVAL",
str.Fetch().mo.mro_raw_Str.Get(str),
new Niecza.CLRBackend.Handle(outer),
new Niecza.CLRBackend.Handle(th.caller)
@@ -2100,7 +2100,7 @@ public partial class Builtins {
if (!th.info.rx_compile_cache.TryGetValue(code, out main)) {
if (th.info.setting.upcall_receiver == null)
throw new NieczaException("Cannot eval; no compiler available");
- object r = UpCall(th.info.setting, "eval",
+ object r = UpCall(th.info.setting, "EVAL",
"regex {" + code + "}",
new Niecza.CLRBackend.Handle(th.info));
if (r is Exception)
View
@@ -744,7 +744,7 @@ my class Cool {
method trim-leading () { self.subst(/^ \s+/, "") }
method trim-trailing() { self.subst(/\s+ $/, "") }
method trim () { self.trim-leading.trim-trailing }
- method eval() { eval(~self) }
+ method EVAL() { EVAL(~self) }
method fmt(Str $format = '%s') {
sprintf($format, self);
@@ -3573,7 +3573,7 @@ sub infix:« ==>> »(\|$args) { die "Feed ops NYI" } #OK
sub infix:« <== »(\|$args) { die "Feed ops NYI" } #OK
sub infix:« <<== »(\|$args) { die "Feed ops NYI" } #OK
-sub eval($str,:$lang="perl6") is return-pass {
+sub EVAL($str,:$lang="perl6") is return-pass {
if $lang eq "perl6" {
Q:CgOp { (simple_eval {$str}) }
} else {
View
@@ -5,7 +5,7 @@ my ($prologue, $baseline);
sub mktimer($code is copy) {
$code = "$code ;" x 20;
$code = '\qq[$prologue]; sub ($__j is copy) { my $__i = times[0]; (\qq[$code]) while --$__j; times[0] - $__i } #OK';
- eval $code;
+ EVAL $code;
}
sub fnum($n) { $n ~~ /:i e/ ?? $n !! substr($n,0,6) }
View
@@ -138,16 +138,16 @@ sub fails_ok($code,$why?,:$expect = <die warn fail>) is export {
$*TEST-BUILDER.ok(?(no-control($code) eq any(@$expect)), $why);
}
sub eval_lives_ok($code,$why?) is export {
- $*TEST-BUILDER.ok(no-control({ eval $code }, :diag) ne "die", $why);
+ $*TEST-BUILDER.ok(no-control({ EVAL $code }, :diag) ne "die", $why);
}
sub eval_dies_ok($code,$why?) is export {
- $*TEST-BUILDER.ok(no-control({ eval $code }) eq "die", $why);
+ $*TEST-BUILDER.ok(no-control({ EVAL $code }) eq "die", $why);
}
sub eval_succeeds_ok($code,$why?,:$ignore = ()) is export {
- $*TEST-BUILDER.ok(?(no-control({ eval $code }) eq any("", @$ignore)), $why);
+ $*TEST-BUILDER.ok(?(no-control({ EVAL $code }) eq any("", @$ignore)), $why);
}
sub eval_fails_ok($code,$why?,:$expect = <die warn fail>) is export {
- $*TEST-BUILDER.ok(?(no-control({ eval $code }) eq any(@$expect)), $why);
+ $*TEST-BUILDER.ok(?(no-control({ EVAL $code }) eq any(@$expect)), $why);
}
sub diag($str) is export { $*TEST-BUILDER.note($str) }
sub is_approx(Mu $got, Mu $expected, $desc = '') is export {
View
@@ -41,6 +41,6 @@ grammar JSONGrammar {
}
}
-JSONGrammar.parse(eval 'local $/; <STDIN>')
+JSONGrammar.parse(EVAL 'local $/; <STDIN>')
# vim: ft=perl6
@@ -24,7 +24,7 @@ use Niecza::Object;
=head1 SYNOPSIS
use v6;
-eval(:lang<perl5>,"...");
+EVAL(:lang<perl5>,"...");
=head1 AUTHOR
View
@@ -3565,7 +3565,7 @@ method use_from_perl5($/,$name) {
class => 'Code');
my $p5code = '\\&'~$func;
- my $p5sub = $OpCallSub.new(pos=>$/,invocant=>mklex($/,'&eval'),args=>[$OpStringLiteral.new(text=>$p5code),$OpSimplePair.new(key=>'lang',value=>$OpStringLiteral.new(text=>'perl5'))]);
+ my $p5sub = $OpCallSub.new(pos=>$/,invocant=>mklex($/,'&EVAL'),args=>[$OpStringLiteral.new(text=>$p5code),$OpSimplePair.new(key=>'lang',value=>$OpStringLiteral.new(text=>'perl5'))]);
$placeholder.add_my_name('|capture');
my $sig = $Sig.new(params => [$SigParameter.new(flags=>$Sig::SLURPY_CAP,name=>'|capture',slot=>'|capture')]);
$placeholder.set_signature($sig);
@@ -26,9 +26,9 @@ sub locstr($fo, $lo, $fn, $ln) {
sub upcalled(*@args) {
my $v = $*compiler.verbose;
given @args[0] {
- when "eval" {
+ when "EVAL" {
my $*IN_EVAL = True;
- say "eval: @args[1] from @args[2].name()" if $v;
+ say "EVAL: @args[1] from @args[2].name()" if $v;
return $*compiler.compile_string(@args[1], True, :evalmode,
:outer(@args[2]), :outer_frame(@args[3]));
}
View
@@ -17,14 +17,14 @@ sub mklet($value, $body) is export {
sub mkcall($/, $name, *@positionals) is export {
$/.CURSOR.mark_used($name);
- $*CURLEX<!sub>.noninlinable if $name eq '&eval'; # HACK
+ $*CURLEX<!sub>.noninlinable if $name eq '&EVAL'; # HACK
$OpCallSub.new(pos=>$/,
invocant => $OpLexical.new(pos=>$/, :$name), :@positionals);
}
sub mklex($/, $name, *%_) is export {
$/.CURSOR.mark_used($name);
- $*CURLEX<!sub>.noninlinable if $name eq '&eval'; # HACK
+ $*CURLEX<!sub>.noninlinable if $name eq '&EVAL'; # HACK
$OpLexical.new(pos=>$/, :$name, |%_);
}
View
@@ -118,7 +118,7 @@ class Method is Operator {
$OpInterrogative.new(pos=>$/, receiver => @args[0],
name => $.name);
} else {
- $*CURLEX<!sub>.noninlinable if $!name eq 'eval';
+ $*CURLEX<!sub>.noninlinable if $!name eq 'EVAL';
my $pclass;
if $.private {
if $.package {
View
@@ -1,6 +1,6 @@
use v6;
use Test;
-my $LoS = eval(:lang<perl5>,q:to/PERL5/);
+my $LoS = EVAL(:lang<perl5>,q:to/PERL5/);
use Data::Dumper;
my $LoS = Niecza::create_LoS(["foo1","bar1","baz1"]);
$LoS;
View
@@ -201,7 +201,7 @@
push @frags, "is ckb(1 @$lt 2 @$gt 3), $right_br_ord, '$msg (1)';\n";
push @frags, "is ckb(1 @$gt 2 @$lt 3), $right_br_opp, '$msg (2)';\n";
}
- eval @frags.join;
+ EVAL @frags.join;
}
{
View
@@ -65,17 +65,17 @@
multi qux(Any:U $) { "U" }
multi qux(Any:D $) { "D" }
- lives_ok { eval "foo(Int)" }, ":U allows type objects";
- dies_ok { eval "foo(5)" }, ":U denies concrete objects";
+ lives_ok { EVAL "foo(Int)" }, ":U allows type objects";
+ dies_ok { EVAL "foo(5)" }, ":U denies concrete objects";
- lives_ok { eval "bar(5)" }, ":D allows concrete objects";
- dies_ok { eval "bar(Int)" }, ":D denies type objects";
+ lives_ok { EVAL "bar(5)" }, ":D allows concrete objects";
+ dies_ok { EVAL "bar(Int)" }, ":D denies type objects";
- lives_ok { eval "moo(5)" }, ":_ allows concrete objects";
- lives_ok { eval "moo(Int)" }, ":_ allows type objects";
+ lives_ok { EVAL "moo(5)" }, ":_ allows concrete objects";
+ lives_ok { EVAL "moo(Int)" }, ":_ allows type objects";
- lives_ok { eval "cow(Int)" }, ":T allows type objects";
- dies_ok { eval "cow(5)" }, ":T denies concrete objects";
+ lives_ok { EVAL "cow(Int)" }, ":T allows type objects";
+ dies_ok { EVAL "cow(5)" }, ":T denies concrete objects";
is qux(Int), 'U', 'multi can discriminate on :U/:D (1)';
is qux(5), 'D', 'multi can discriminate on :U/:D (2)';

0 comments on commit 48a8de3

Please sign in to comment.