Skip to content

Instantly share code, notes, and snippets.

@cygx
Created November 18, 2015 20:41
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 cygx/84b6245ac28213a8667f to your computer and use it in GitHub Desktop.
Save cygx/84b6245ac28213a8667f to your computer and use it in GitHub Desktop.
use nqp;
sub update_dict(%dict, $w) {
my $tagged := '$$' ~ $w ~ '%';
my int $end = $tagged.chars - 2;
loop (my int $idx = 0; $idx < $end; $idx = $idx + 1) {
++%dict{nqp::substr($tagged,$idx,3)};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment