@@ -1200,9 +1200,9 @@ Routines that manipulate arrays and other mutable collections.
1200
1200
1201
1201
Defined as:
1202
1202
1203
- multi sub pop(@collection ) is raw
1203
+ multi sub pop(@a ) is raw
1204
1204
1205
- Calls method C < pop > on the C < Positional > collection . That method is supposed to
1205
+ Calls method C < pop > on the C < Positional > argument . That method is supposed to
1206
1206
remove and return the last element, or return a L < C < Failure > |/type/Failure> if
1207
1207
the collection is empty.
1208
1208
@@ -1213,9 +1213,9 @@ for an example.
1213
1213
1214
1214
Defined as:
1215
1215
1216
- multi sub shift(@collection ) is raw
1216
+ multi sub shift(@a ) is raw
1217
1217
1218
- Calls method C < shift > on the C < Positional > collection . That method, on
1218
+ Calls method C < shift > on the C < Positional > argument . That method, on
1219
1219
a mutable collection that actually implements it (such as an
1220
1220
L < C < Array > |/routine/shift#(Array)_method_shift> or a
1221
1221
L < C < Buf > |/routine/shift#(Buf)_method_shift> ), is supposed to remove
@@ -1235,40 +1235,41 @@ say shift @a; # ERROR: «Cannot shift from an empty Array[Int]»
1235
1235
1236
1236
Defined as:
1237
1237
1238
- multi sub push(\collection , **@values is raw)
1239
- multi sub push(\collection , \arg )
1238
+ multi sub push(\a , **@b is raw)
1239
+ multi sub push(\a , \b )
1240
1240
1241
- Calls method C < push > on the collection, which is supposed to add the provided
1242
- values to the end of the collection or parts thereof. See the documentation of
1243
- the L < C < Hash > method|/routine/push#(Hash)_method_push> for an example where
1241
+ Calls method C < push > on the first argument, passing the remaining arguments.
1242
+ Method C < push > is supposed to add the provided values to the end of the
1243
+ collection or parts thereof. See the documentation of the
1244
+ L < C < Hash > method|/routine/push#(Hash)_method_push> for an example where
1244
1245
indirection via this subroutine can be helpful.
1245
1246
1246
- The C < push > method of the collection is supposed to flatten all arguments of
1247
- type C < Slip > . Therefore, if you want to implement a conforming method for a new
1248
- collection type, it should behave as if its signature was just:
1247
+ The C < push > method is supposed to flatten all arguments of type C < Slip > .
1248
+ Therefore, if you want to implement a conforming method for a new collection
1249
+ type, it should behave as if its signature was just:
1249
1250
1250
- multi method push(::?CLASS:D: **@values --> ::?CLASS:D)
1251
+ multi method push(::?CLASS:D: **@values is raw --> ::?CLASS:D)
1251
1252
1252
1253
Autovivification to an instance of the new type is L < provided by the default
1253
1254
base class|/routine/append#(Any)_method_append > if the new type implements the
1254
1255
C < Positional > role. If the new type is not C < Positional > , autovivification can
1255
- be implemented by an additional multi method with a signature like
1256
+ be supported by an adding a multi method with a signature like
1256
1257
1257
- multi method push(::?CLASS:U: **@values --> ::?CLASS:D)
1258
+ multi method push(::?CLASS:U: **@values is raw --> ::?CLASS:D)
1258
1259
1259
1260
= head2 sub append
1260
1261
1261
1262
Defined as:
1262
1263
1263
- multi sub append(\collection , **@values is raw)
1264
- multi sub append(\collection , \arg )
1264
+ multi sub append(\a , **@b is raw)
1265
+ multi sub append(\a , \b )
1265
1266
1266
- Calls method C < append > on the collection, which is supposed to add the provided
1267
- values to the end of the collection or parts thereof. Unlike method C < push > ,
1268
- method C < append > should follow the L < single argument
1269
- rule|/language/functions#Slurpy_conventions > . So if you want to implement a
1270
- conforming method C < append > for a new collection type, it should behave as if
1271
- its signature was just:
1267
+ Calls method C < append > on the first argument, passing the remaining arguments.
1268
+ Method C < append > is supposed to add the provided values to the end of the
1269
+ collection or parts thereof. Unlike method C < push > , method C < append > should
1270
+ follow the L < single argument rule|/language/functions#Slurpy_conventions> . So
1271
+ if you want to implement a conforming method C < append > for a new collection
1272
+ type, it should behave as if its signature was just:
1272
1273
1273
1274
multi method append(::?CLASS:D: +values --> ::?CLASS:D)
1274
1275
0 commit comments