~ubuntu-branches/ubuntu/vivid/nqp/vivid

« back to all changes in this revision

Viewing changes to src/how/NQPParametricRoleHOW.pm

  • Committer: Package Import Robot
  • Author(s): Alessandro Ghedini
  • Date: 2012-06-08 14:57:52 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120608145752-ziumy2rhxboeuf3r
Tags: 0.1~2012.04.1-1
* New upstream release
* Bump required parrot version
* Refresh patches
* Bump upstream copyright years for dyncall
* Use dh_parrot debhelper plugin

Show diffs side-by-side

added added

removed removed

Lines of Context:
124
124
 
125
125
        # Capture methods in the correct lexical context.
126
126
        for %!methods {
127
 
            $irole.HOW.add_method($irole, $_.key, reify_method($_.value));
 
127
            $irole.HOW.add_method($irole, $_.key, $_.value.clone());
128
128
        }
129
129
        for @!multi_methods_to_incorporate {
130
130
            $irole.HOW.add_multi_method($irole, $_<name>, reify_method($_<code>));
140
140
        $irole.HOW.compose($irole);
141
141
        return $irole;
142
142
    }
143
 
    
144
 
    # Methods may have a reification callback that we should invoke to
145
 
    # do the reification. Otherwise, it's just a clone.
146
 
    sub reify_method($meth) {
147
 
        my $callback := pir::getprop__PsP('REIFY_CALLBACK', $meth);
148
 
        pir::defined($callback) ?? $callback($meth) !! pir::clone($meth)
149
 
    }
150
143
 
151
144
    ##
152
145
    ## Introspecty