Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (20 sloc) 0.532 kB
use v6;
use Test;
#L<S06/"Macros">
plan 4;
{
my $z = 3;
my $in_macro;
my $in_macro_clos;
macro returns_a_closure {
my $x = 42;
$in_macro = 1;
return { $in_macro_clos++; 100 + $x + $z };
}
is $in_macro, 1, "macro was executed during compile time";
ok !$in_macro_clos, "macro closure was not executed during compile time";
#?pugs todo
is returns_a_closure, 145, "closure returning macro";
is $in_macro_clos, 1, "macro closure was executed during runtime";
}
# vim: ft=perl6
Jump to Line
Something went wrong with that request. Please try again.