daily pastebin goal
11%
SHARE
TWEET

[Perl 6] Higher-order function combo demo.

cwchen Nov 28th, 2017 120 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. my $n =
  2.     reduce { $^a + $^b },
  3.     map { $_ ** 2 },
  4.     grep { $_ mod 2 != 0 },
  5.         1..10;
  6.  
  7. $n == 1 ** 2 + 3 ** 2 + 5 ** 2 + 7 ** 2 + 9 ** 2 or die "Wrong value";
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top