Skip to content

Commit

Permalink
Fix up add_method on the metaclass to be more inline with the HOW API…
Browse files Browse the repository at this point in the history
… proposed by smop.
  • Loading branch information
jnthn committed Aug 21, 2009
1 parent ef035f4 commit 0a5b07e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions src/classes/ClassHOW.pir
Expand Up @@ -481,6 +481,19 @@ Accessor for hidden property.
.return ($P0)
.end
=item add_method
=cut
.sub 'add_method' :method
.param pmc obj
.param string name
.param pmc meth
$P0 = getattribute self, 'parrotclass'
addmethod $P0, name, meth
.end
=back
=cut
Expand Down
4 changes: 2 additions & 2 deletions src/parrot/Protoobject.pir
Expand Up @@ -134,14 +134,14 @@ Indicate that objects in the class are mutable or immutable.
.sub '!IMMUTABLE' :method
$P0 = get_root_global [.RAKUDO_HLL ; 'Int'], 'Scalar'
$P1 = self.'HOW'()
$P1.'add_method'('Scalar', $P0, 'to'=>self)
$P1.'add_method'(self, 'Scalar', $P0)
.end
.namespace ['P6protoobject']
.sub '!MUTABLE' :method
$P0 = get_root_global [.RAKUDO_HLL ; 'Perl6Object'], 'Scalar'
$P1 = self.'HOW'()
$P1.'add_method'('Scalar', $P0, 'to'=>self)
$P1.'add_method'(self, 'Scalar', $P0)
.end
=back
Expand Down

0 comments on commit 0a5b07e

Please sign in to comment.