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
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ role Perl6::Metamodel::RolePunning {

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

# 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 {
$!pun := self.make_pun($obj);
$!made_pun := 1;
}
-> $inv, *@pos, *%named {
$!pun."$name"(|@pos, |%named)
Expand Down

0 comments on commit 21089d9

Please sign in to comment.