daily pastebin goal
18%
SHARE
TWEET

[Perl 6] Subroutine with type info

cwchen Nov 15th, 2017 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. sub add-one(Int $n) of Int {
  2.     $n + 1;
  3. }
  4.  
  5. add-one(3) == 4 or die "Wrong value";
RAW Paste Data
Top