Skip to content

Instantly share code, notes, and snippets.

@gfldex
Created March 27, 2021 01:33
Show Gist options
  • Save gfldex/96fad87c7bcb1c03c5584c37612aae91 to your computer and use it in GitHub Desktop.
Save gfldex/96fad87c7bcb1c03c5584c37612aae91 to your computer and use it in GitHub Desktop.
use v6.d;
multi sub _when(Int $i) { dd $i; }
multi sub _when($_ where $_ ~~ /(\w+)/) { say $0 }
given 42 {
$_.&_when;
}
given 'word' {
$_.&_when;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment