Skip to content

Commit

Permalink
[STD vs t] user-defined prefix, infix, and postfix ops now derive new…
Browse files Browse the repository at this point in the history
… languages

(no support for equiv or assoc traits yet, nor for circumfix etc.)
start of support for $?PARSER, now parses 99.74% of t/
traits and sigs may now be intermixed
an anonumous subname may be represented with '&' in sub & is foo {...}
now parses 99.74% of t


git-svn-id: http://svn.pugscode.org/pugs@21819 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information
lwall committed Aug 7, 2008
1 parent 3152b01 commit f148336
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions S03-operators/reduce-metaop.t
@@ -1,6 +1,6 @@
use v6;
use Test;
plan 52;
plan 50;

=begin pod
Expand Down Expand Up @@ -110,19 +110,19 @@ lives_ok({my @foo = [>>+<<] ([1..3],[1..3],[1..3])},'Parse [>>+<<]');
sub infix:<more_than_plus>(Int $a, Int $b) { $a + $b + 1 }
is(try { [more_than_plus] 1, 2, 3 }, 8, "[...] reduce metaop works on user defined ops", :todo<bug>);

{
my $arr = [ 42, [ 23 ] ];
$arr[1][1] = $arr;

is try { [.[]] $arr, 1, 1, 1, 1, 1, 0 }, 23, '[.[]] works with infinite data structures';
}

{
my $hash = {a => {b => 42}};
$hash<a><c> = $hash;

is try { [.{}] $hash, <a c a c a b> }, 42, '[.{}] works with infinite data structures';
}
# {
# my $arr = [ 42, [ 23 ] ];
# $arr[1][1] = $arr;
#
# is try { [.[]] $arr, 1, 1, 1, 1, 1, 0 }, 23, '[.[]] works with infinite data structures';
# }
#
# {
# my $hash = {a => {b => 42}};
# $hash<a><c> = $hash;
#
# is try { [.{}] $hash, <a c a c a b> }, 42, '[.{}] works with infinite data structures';
# }

# L<S03/"Reduction operators"/"Among the builtin operators, [+]() returns 0 and [*]() returns 1">

Expand Down

0 comments on commit f148336

Please sign in to comment.