Permalink
Browse files

Avoid some NPMCAs and make sure Positional and Associative roles know…

… their names.
  • Loading branch information...
1 parent 6c7f9ec commit 74591399fbe8b79eb465c575a0d9391a791c5099 @jnthn jnthn committed Feb 8, 2010
Showing with 7 additions and 0 deletions.
  1. +2 −0 src/builtins/Associative.pir
  2. +2 −0 src/builtins/Positional.pir
  3. +3 −0 src/builtins/Role.pir
@@ -15,6 +15,8 @@ src/classes/Associative.pir - Associative Role
.local pmc role
.const 'Sub' $P0 = '_Associative_role_body'
role = new ['Perl6Role']
+ $P1 = box 'Associative'
+ setattribute role, '$!shortname', $P1
role.'!add_variant'($P0)
set_hll_global 'Associative', role
.end
@@ -15,6 +15,8 @@ src/classes/Positional.pir - Positional Role
.local pmc role
.const 'Sub' $P0 = '_positional_role_body'
role = new ['Perl6Role']
+ $P1 = box 'Positional'
+ setattribute role, '$!shortname', $P1
role.'!add_variant'($P0)
set_hll_global 'Positional', role
.end
@@ -261,7 +261,10 @@ just here so postcircumfix:[ ] doesn't explode).
.sub 'Str' :method :vtable('get_string')
$P0 = getattribute self, '$!shortname'
+ $S0 = 'ANON'
+ if null $P0 goto no_name
$S0 = $P0
+ no_name:
concat $S0, '()'
.return ($S0)
.end

0 comments on commit 7459139

Please sign in to comment.