File tree Expand file tree Collapse file tree 3 files changed +13
-9
lines changed Expand file tree Collapse file tree 3 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -137,18 +137,18 @@ knowhow NQPClassHOW {
137
137
}
138
138
139
139
method compose ($ obj ) {
140
- # Incorporate roles. First, instantiate them with the type object
140
+ # Incorporate roles. First, specialize them with the type object
141
141
# for this type (so their $?CLASS is correct). Then delegate to
142
142
# the composer.
143
143
if @ ! roles {
144
- my @ instantiated_roles ;
144
+ my @ specialized_roles ;
145
145
for @ ! roles {
146
- my $ ins := $ _ . HOW . instantiate ($ _ , $ obj );
147
- @ instantiated_roles . push ($ ins );
146
+ my $ ins := $ _ . HOW . specialize ($ _ , $ obj );
147
+ @ specialized_roles . push ($ ins );
148
148
@ ! done [+ @ ! done ] := $ _ ;
149
149
@ ! done [+ @ ! done ] := $ ins ;
150
150
}
151
- RoleToClassApplier. apply($ obj , @ instantiated_roles );
151
+ RoleToClassApplier. apply($ obj , @ specialized_roles );
152
152
}
153
153
154
154
# If we have no parents and we're not called NQPMu then add the
Original file line number Diff line number Diff line change @@ -138,6 +138,10 @@ knowhow NQPConcreteRoleHOW {
138
138
method roles ($ obj ) {
139
139
@ ! roles
140
140
}
141
+
142
+ method does_list ($ obj ) {
143
+ @ ! done
144
+ }
141
145
142
146
method instance_of ($ obj ) {
143
147
$ ! instance_of
Original file line number Diff line number Diff line change @@ -102,9 +102,9 @@ knowhow NQPParametricRoleHOW {
102
102
1
103
103
}
104
104
105
- # This instantiates the role for the given class and builds a concrete
105
+ # This specializes the role for the given class and builds a concrete
106
106
# role.
107
- method instantiate ($ obj , $ class_arg ) {
107
+ method specialize ($ obj , $ class_arg ) {
108
108
# Run the body block to capture the arguments into the correct
109
109
# type argument context.
110
110
$ ! body_block ($ class_arg );
@@ -128,8 +128,8 @@ knowhow NQPParametricRoleHOW {
128
128
129
129
# Copy roles, instantiating them as we go.
130
130
for @ ! roles {
131
- my $ instantiated := $ irole . HOW . instantiate ($ irole , $ class_arg );
132
- $ irole . HOW . add_role($ irole , $ instantiated );
131
+ my $ specialized := $ irole . HOW . specialize ($ irole , $ class_arg );
132
+ $ irole . HOW . add_role($ irole , $ specialized );
133
133
}
134
134
135
135
# Compose and return produced role.
You can’t perform that action at this time.
0 commit comments