Skip to content

Instantly share code, notes, and snippets.

@skrisna
Created December 9, 2016 05:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skrisna/50ec2b89a8c166f081640f212e5975f2 to your computer and use it in GitHub Desktop.
Save skrisna/50ec2b89a8c166f081640f212e5975f2 to your computer and use it in GitHub Desktop.
subset Prime of Int where *.is-prime;
subset SmallPrime of Prime where * < 40_000;
subset BigPrime of Prime where * >= 10_000;
multi MAIN ( BigPrime $num ) { say "Prime number! Nice and big"; }
multi MAIN ( SmallPrime $num ) { say "Puny prime number"; }
multi MAIN ( $num ) { say "Gimme prime!"; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment