develooper Front page | perl.perl6.language | Postings from May 2004

hyper-hyper operators?

Thread Next
From:
Dave Whipp
Date:
May 20, 2004 09:07
Subject:
hyper-hyper operators?
Message ID:
20040520160741.7972.qmail@onion.perl.org
Is it possible to "hyper" a hyper operator?

For example, given:

  my @m = ( [1,2], [3,4], [5,6] );

  my $a = @m + 1;
  my $b = @m +« 1;
  my $c = @m +«« 1;

is it true that:

  ok($a == 4);
  ok($b »==« [ 3, 3, 3 ];
  ok($c »»==«« [ [2,3], [4,5], [6,7] ];

Is there an "infinite depth" hyper operator for operating on trees?


Dave.



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About