Skip to content

Commit

Permalink
Only make a pun once.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Sep 9, 2011
1 parent 8c9dd1a commit 21089d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Perl6/Metamodel/RolePunning.pm
Expand Up @@ -27,12 +27,11 @@ role Perl6::Metamodel::RolePunning {


# Produces something that can be inherited from (the pun). # Produces something that can be inherited from (the pun).
method inheritalize($obj) { method inheritalize($obj) {
if $!made_pun { unless $!made_pun {
$!pun
}
else {
$!pun := self.make_pun($obj); $!pun := self.make_pun($obj);
$!made_pun := 1;
} }
$!pun
} }


# Do a pun-based dispatch. If we pun, return a thunk that will delegate. # Do a pun-based dispatch. If we pun, return a thunk that will delegate.
Expand All @@ -42,6 +41,7 @@ role Perl6::Metamodel::RolePunning {
} }
unless $!made_pun { unless $!made_pun {
$!pun := self.make_pun($obj); $!pun := self.make_pun($obj);
$!made_pun := 1;
} }
-> $inv, *@pos, *%named { -> $inv, *@pos, *%named {
$!pun."$name"(|@pos, |%named) $!pun."$name"(|@pos, |%named)
Expand Down

0 comments on commit 21089d9

Please sign in to comment.