You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ops.markdown
+68-11Lines changed: 68 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -225,31 +225,88 @@ Return non-zero if the two parameters are not equal.
225
225
226
226
# Array opcodes
227
227
228
+
## atpos
229
+
*`atpos(Any @arr, int $i)`
230
+
*`atpos_i(int @arr, int $i)`
231
+
*`atpos_n(num @arr, int $i)`
232
+
*`atpos_s(str @arr, int $i)`
233
+
234
+
Return whatever is bound to @arr at position $i.
235
+
236
+
## bindpos
237
+
*`bindpos(Any @arr, int $i, Any $v)`
238
+
*`bindpos_i(int @arr, int $i, int $v)`
239
+
*`bindpos_n(num @arr, int $i, num $v)`
240
+
*`bindpos_s(str @arr, int $i, str $v)`
241
+
242
+
Bind $v to @arr at position $i and return $v.
243
+
244
+
## push
245
+
*`push(Any @arr, Any $v)`
246
+
*`push_i(int @arr, int $v)`
247
+
*`push_n(num @arr, num $v)`
248
+
*`push_s(str @arr, str $v)`
249
+
250
+
"Push $v onto the end of @arr."
251
+
Bind $v to @arr at the position at the end of @arr, i.e., the position that is just after the last position of @arr that has been bound to.
252
+
Return the number of elements of @arr on Parrot, $v on JVM.
253
+
254
+
## pop
255
+
*`pop(Any @arr)`
256
+
*`pop_i(int @arr)`
257
+
*`pop_n(num @arr)`
258
+
*`pop_s(str @arr)`
259
+
260
+
"Pop the last value off the end of @arr."
261
+
Return the value of @arr at it's last bound position, and unbind @arr at that position.
262
+
263
+
## unshift
264
+
*`unshift(Any @arr, Any $v)`
265
+
*`unshift_i(int @arr, int $v)`
266
+
*`unshift_n(num @arr, num $v)`
267
+
*`unshift_s(str @arr, str $v)`
268
+
269
+
"Shift $v into the beginning of @arr."
270
+
Bind $v to @arr at index 0, move all other bindings of @arr to the index one above what they were previously bound to.
271
+
Return the number of elements of @arr on Parrot, $v on JVM.
272
+
273
+
## shift
274
+
*`shift(Any @arr)`
275
+
*`shift_i(int @arr)`
276
+
*`shift_n(num @arr)`
277
+
*`shift_s(str @arr)`
278
+
279
+
"Shift the last value from the beginning of @arr."
280
+
Return the value of @arr at index 0, unbind @arr at index 0, and move all other binding of @arr to the index one below what they were previously bound to.
281
+
282
+
## splice
283
+
*`splice(Any @arr, Any $from, int $offset, int $count)`
284
+
228
285
# Hash opcodes
229
286
230
287
## atkey
231
-
*`atkey(Any %hash, String $key)`
232
-
*`atkey_i(int %hash, String $key)`
233
-
*`atkey_n(num %hash, String $key)`
234
-
*`atkey_s(str %hash, String $key)`
288
+
*`atkey(%hash, String $key)`
289
+
*`atkey_i(%hash, String $key)`
290
+
*`atkey_n(%hash, String $key)`
291
+
*`atkey_s(%hash, String $key)`
235
292
236
293
Return the value of %hash at key $key.
237
294
238
295
## bindkey
239
-
*`bindkey(Any %hash, String $key, Any $b)`
240
-
*`bindkey_i(int %hash, String $key, int $b)`
241
-
*`bindkey_n(num %hash, String $key, num $b)`
242
-
*`bindkey_s(str %hash, String $key, str $b)`
296
+
*`bindkey(%hash, String $key, Any $v)`
297
+
*`bindkey_i(%hash, String $key, int $v)`
298
+
*`bindkey_n(%hash, String $key, num $v)`
299
+
*`bindkey_s(%hash, String $key, str $v)`
243
300
244
-
Bind key $key of %hash to $b and return $b.
301
+
Bind key $key of %hash to $v and return $v.
245
302
246
303
## existskey
247
-
*`existskey(Any %hash, String $key)`
304
+
*`existskey(%hash, String $key)`
248
305
249
306
Return non-zero if %hash has key $key bound to something.
0 commit comments