Skip to content

Instantly share code, notes, and snippets.

@renormalist
Created August 12, 2017 10:53
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 renormalist/f26df587188460bc5b7f4c4d9f82367a to your computer and use it in GitHub Desktop.
Save renormalist/f26df587188460bc5b7f4c4d9f82367a to your computer and use it in GitHub Desktop.
silly given/when
for @els -> $t {
my $f = False;
given $t.WHAT {
when Perl6::String::Interpolation { print "INTERPOLATION"; $f=True}
when Perl6::Bareword { print "BAREWORD"; $f=True }
}
say " ({$t.content})" if $f;
}
@renormalist
Copy link
Author

            my $f = True;
            given $t.WHAT {
                when Perl6::String::Interpolation { print "INTERPOLATION" }
                when Perl6::Bareword { print "BAREWORD" }
                default { $f = False }
            }
            say " ({$t.content})" if $f;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment