Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Only make a pun once.

  • Loading branch information...
commit 21089d981d2569cc767f78fe71a3506145536fd3 1 parent 8c9dd1a
@jnthn jnthn authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/Perl6/Metamodel/RolePunning.pm
View
8 src/Perl6/Metamodel/RolePunning.pm
@@ -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.
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.