Skip to content

Instantly share code, notes, and snippets.

@samuraisam
Created June 21, 2013 01:48
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 samuraisam/5828293 to your computer and use it in GitHub Desktop.
Save samuraisam/5828293 to your computer and use it in GitHub Desktop.
class Thing {
has Str $.attr;
}
multi infix:<eq>(Thing $a, Thing $b) {
$a.attr eq $b.attr;
}
say "eq: ", Thing.new(:attr<ab>) eq Thing.new(:attr<ab>);
say "eq list: ", [Thing.new(:attr<ab>)] eqv [Thing.new(:attr<ab>)];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment