~ubuntu-branches/ubuntu/raring/rakudo/raring

« back to all changes in this revision

Viewing changes to src/Perl6/Metamodel/Mixins.pm

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2012-11-29 01:00:04 UTC
  • mfrom: (7.1.5 raring-proposed)
  • Revision ID: package-import@ubuntu.com-20121129010004-3vmbbb2e53up4u14
Tags: 2012.10-1build1
Rebuild with the current version of the Not Quite Perl compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
        my @role_names;
9
9
        for @roles { @role_names.push($_.HOW.name($_)) }
10
10
        my $new_name := self.name($obj) ~ '+{' ~
11
 
            pir::join(',', @role_names) ~ '}';
 
11
            nqp::join(',', @role_names) ~ '}';
12
12
        
13
13
        # Create new type, derive it from ourself and then add
14
14
        # all the roles we're mixing it.
20
20
        }
21
21
        $new_type.HOW.compose($new_type);
22
22
        $new_type.HOW.set_boolification_mode($new_type,
23
 
            pir::exists($new_type.HOW.method_table($new_type), 'Bool') ?? 0 !!
 
23
            nqp::existskey($new_type.HOW.method_table($new_type), 'Bool') ?? 0 !!
24
24
                self.get_boolification_mode($obj));
25
25
        $new_type.HOW.publish_boolification_spec($new_type);
26
26
        
27
27
        # If the original object was concrete, change its type by calling a
28
28
        # low level op. Otherwise, we just return the new type object
29
 
        nqp::isconcrete($obj) ??
30
 
            pir::repr_change_type__0PP($obj, $new_type) !!
31
 
            $new_type
 
29
        nqp::isconcrete($obj) ?? nqp::rebless($obj, $new_type) !! $new_type
32
30
    }
33
31
}