@@ -2450,20 +2450,23 @@ appropriate adverb to the subscript.
2450
2450
@array[0,1,2] :kv; # returns 0, 'A', 1, 'B'
2451
2451
@array[0,1,2] :k; # returns 0, 1
2452
2452
@array[0,1,2] :v; # returns 'A', 'B'
2453
+ @array[0,1,2] :vk; # returns 'A', 0, 'B', 1
2453
2454
2454
2455
%hash = (:a<A>, :b<B>);
2455
2456
%hash<a b c>; # returns 'A', 'B', (Any)
2456
2457
%hash<a b c> :p; # returns a => 'A', b => 'B'
2457
2458
%hash<a b c> :kv; # returns 'a', 'A', 'b', 'B'
2458
2459
%hash<a b c> :k; # returns 'a', 'b'
2459
2460
%hash<a b c> :v; # returns 'A', 'B'
2461
+ %hash<a b c> :vk; # returns 'A', 'a', 'B', 'b'
2460
2462
2461
2463
These adverbial forms all weed out non-existing entries if the
2462
2464
adverb is true; if not, they leave them in, just as an ordinary slice would.
2463
2465
So:
2464
2466
2465
2467
@array[0,1,2] :!p; # returns 0 => 'A', 1 => 'B', 2 => (Any)
2466
2468
%hash<a b c> :!kv; # returns 'a', 'A', 'b', 'B', 'c', (Any)
2469
+ %hash<a b c> :!vk; # returns 'A', 'a', 'B', 'b', (Any), 'c'
2467
2470
2468
2471
Likewise,
2469
2472
@@ -2534,16 +2537,20 @@ These combinations are considered legal and mean the following:
2534
2537
:delete :!p delete, return pairs of all keys attempted
2535
2538
:delete :kv delete, return key/values of actually deleted keys
2536
2539
:delete :!kv delete, return key/values of all keys attempted
2537
- :delete :v delete, return values of actually deleted keys
2538
- :delete :!v delete, return values of all keys attempted
2539
2540
:delete :k delete, return actually deleted keys
2540
2541
:delete :!k delete, return all keys attempted to delete
2542
+ :delete :v delete, return values of actually deleted keys
2543
+ :delete :!v delete, return values of all keys attempted
2544
+ :delete :vk delete, return value/keys of actually deleted keys
2545
+ :delete :!vk delete, return value/keys of all keys attempted
2541
2546
:delete :exists delete, return Bools indicating keys existed
2542
2547
:delete :!exists delete, return Bools indicating keys did not exist
2543
2548
:delete :exists :p delete, return pairs with key/True for key existed
2544
2549
:delete :exists :!p delete, return pairs with key/Bool whether key existed
2545
2550
:delete :exists :kv delete, return list with key,True for key existed
2546
2551
:delete :exists :!kv delete, return list with key,Bool whether key existed
2552
+ :delete :exists :vk delete, return list with True,key for key existed
2553
+ :delete :exists :!vk delete, return list with Bool,key whether key existed
2547
2554
2548
2555
An implementation is free to silently ignore any other combinations or
2549
2556
silently prefer one of the adverbs given above any other.
0 commit comments