Hashes & sets
Hash, Map, Pair, object hashes, and the Set, Bag and Mix family.
111 rules from 73 tests. 69 of those tests are confirmed on both engines: Raku++ and Rakudo 2026.11 both pass, or Raku++ gives Rakudo's answer on every probe of a family. The verdict is the test's, not each rule's. How to read a case.
6e-gatingRaku++ passesRakudo cannot run it- 6
From 6.e
%h{**}walks to the leaves of a nested hash; before 6.e**is a missing key.with
%h = A => { B => 1, C => 2 }, D => 3,%h{**}is(1, 2, 3)under 6.e andAnyunder 6.d - 7
A hash multislice selecting one value returns the value itself from 6.e and a one-element list before.
%h{'A';'B'}is42under 6.e and(42,)under 6.d - 18
From 6.e an object hash declared without a value type has value type
Mu; before 6.e it isAny.my %h{Str}; %h.of.^nameisMuunder 6.e andAnyunder 6.d
More from this test: Dates & times (2), Exceptions & control flow (1), I/O & processes (2), Lists & laziness (8), Numerics (1), Classes, roles & the MOP (2), Operators (1), Everything else (2), Regexes & grammars (2), Scoping & phasers (2), Signatures & dispatch (1), Strings & Unicode (6), divergences (1).
anton-batch-round2Raku++ passesRakudo passes- 1
Set membership with
(elem)/(cont)is an identity question: a Str, a Rat or an allomorph is not an element where the Int is.'123' (elem) [123]is False;<42> (elem) [42]is False;123 (elem) [123]is True - 2
For a Hash operand of
(elem)the keys are the elements, not the values.'a' (elem) {a => 42}is True;42 (elem) {a => 42}is False - 3
.pickon a Set returns an element with the type it went in with.set(1,2).pick.WHAT.^nameisInt
More from this test: Native types & NativeCall (1), Classes, roles & the MOP (2), Regexes & grammars (3), Signatures & dispatch (1).
array-op-args-getc-get-and-friendsRaku++ passesRakudo passes- 5
%h.appendonto a key whose value is a List turns that slot into an Array.
More from this test: Compile-time errors (1), I/O & processes (1), Numerics (1), Classes, roles & the MOP (1), Signatures & dispatch (2).
assoc-index-on-scalar-diesRaku++ passesRakudo passes- 1
Associative indexing on a defined non-Associative value dies with "Type Str does not support associative indexing." (naming the value's type).
$str<key>dies
More from this test: Syntax & parsing (1).
async-socket-tapsRaku++ passesRakudo passes- 4
.keysof an object-keyed hash returns the original key objects, not their stringifications. inferred
More from this test: Concurrency (4).
audited-language-gaps-1Raku++ passesRakudo passes- 10
BagHash.addcounts each item it is given.
More from this test: Concurrency (1), Containers & assignment (1), Exceptions & control flow (1), Lists & laziness (2), Operators (1), Regexes & grammars (2), Signatures & dispatch (3), Syntax & parsing (2).
audited-language-gaps-3Raku++ passesRakudo passes- 2
The key of
$item => …is decontainerized.
More from this test: I/O & processes (1), Lists & laziness (1), Native types & NativeCall (1), Strings & Unicode (1).
audited-language-gaps-4Raku++ passesRakudo passes- 2
.BIND-KEY($k, EXPR)evaluates EXPR once.
More from this test: Compile-time errors (1), Classes, roles & the MOP (1), Everything else (2).
battery-regressions-v5Raku++ passesRakudo passes- 4
self = …in a method called on a Hash is a store into that Hash.
More from this test: I/O & processes (1), Modules (2), Classes, roles & the MOP (1), Operators (1), Regexes & grammars (1), Signatures & dispatch (2).
blob-numeric-and-zip-metaopRaku++ passesRakudo passes- 5
A key produced by
Z=>keeps its type rather than being stringified. inferred
More from this test: Lists & laziness (1), Operators (1), Types & coercion (2).
bson-simple-and-hash-agnosticRaku++ passesRakudo passes- 13
A class that implements the Associative protocol (
AT-KEY,EXISTS-KEY,keys), even through a composed role, supports the subscript adverbs:vand:kand the zen and whatever slices.$a{<x y>}:kgives the keysx,y
More from this test: Containers & assignment (4), Dates & times (1), Modules (1), Classes, roles & the MOP (2), Operators (1), Signatures & dispatch (2), Stringification (1), Strings & Unicode (1), Types & coercion (1).
coercing-return-typeRaku++ passesRakudo passes- 2
.Mapon a Pair or list of Pairs answers a Map, not a Hash.(a => 1).Mapis a Map
More from this test: Signatures & dispatch (1).
coercion-typed-element-storesRaku++ passesRakudo passes- 2
Hash.appendonto an existing key makes[|old, |new]andHash.pushmakes[old, new]. - 3
A Hash given to
Hash.appendorHash.pushslips into its pairs, so the two hashes merge key by key.my Hash() %options = %defaults; %options.append: %omerges%ointo%options
More from this test: Types & coercion (1).
conformance-phase1-reprRaku++ passesRakudo passes- 3
A
Pairhas.antipairsand.invert: a list value inverts to one pair per element, and the inverted keys keep their type.
More from this test: Lists & laziness (2), Signatures & dispatch (1), Stringification (2), Types & coercion (1).
conformance-phase2-introspectionRaku++ passesRakudo passes- 5
A QuantHash has a typed element default —
Falsefor the Set family,0for the weighted kinds — notAny.
More from this test: Containers & assignment (1), Exceptions & control flow (2), I/O & processes (1), Classes, roles & the MOP (1), Scoping & phasers (1), Signatures & dispatch (2), Types & coercion (1).
container-lists-and-pair-cellsRaku++ passesRakudo passes- 5
The Pairs a Set hands out are read-only: assigning to
.valueof one dies.
More from this test: Containers & assignment (4), Signatures & dispatch (1).
container-raku-of-tagged-valuesRaku++ passesRakudo passes- 2
A Pair keeps a Version, IO::Path or Buf key as what it is, not as its string.
the key of
v1.2 => 1is a Version, not the Str "1.2"
More from this test: Stringification (2).
cro-family-clusterRaku++ passesRakudo passes- 5
%( $hash, pair )merges the hash's entries with the pair instead of treating the hash as a key.
More from this test: Lists & laziness (1), Classes, roles & the MOP (2), Regexes & grammars (3), Syntax & parsing (2).
ecosweep-batch-fiveRaku++ passesRakudo passes- 10
An object hash with a smiley key constraint,
%c{Any:U}, keeps type-object keys distinct, and an enum type object used as a subscript is one key, not a slice.my %by-type{Any:U} = (Pair.new(Flavor, 'f'), Pair.new(Order, 'o')); %by-type{Order}iso
More from this test: Native types & NativeCall (2), Classes, roles & the MOP (2), Operators (1), Regexes & grammars (1), Scoping & phasers (2), Signatures & dispatch (4), Syntax & parsing (1), Types & coercion (2).
ecosweep-batch-threeRaku++ passesRakudo passes- 3
%h{$k} //= RHSleaves no key behind when RHS throws.try { %h<boom> //= die 'no' }leaves%h.elemsat 0
More from this test: Native types & NativeCall (3), Classes, roles & the MOP (1).
engine-objects-list-as-oneRaku++ passesRakudo passes- 2
A Set, Bag or Mix bound to a
$parameter or loop variable is one item, as a Hash is.
More from this test: Lists & laziness (1).
error-messages-rakudo-settledRaku++ passesRakudo passes- 2
MixHash.grabreturns a Failure whose message is ".grab is not supported on a MixHash". inferredMixHash.new(<a b c>).grabis a Failure
More from this test: Exceptions & control flow (2), I/O & processes (1), divergences (1).
exe-pair-key-and-adverbsRaku++ passesRakudo passes- 2
A Pair is associative on its one key, so
$pair<a>:existsis True for a Pair whose key isa.
More from this test: Containers & assignment (1), Types & coercion (1).
exe-value-semanticsRaku++ passesRakudo passes- 7
A missing Hash key or Array index reads as
(Any), a Set's missing key as False, a Bag's as 0, and a List's or Map's missing element as Nil.%h<missing>and@a[99]are(Any) - 8
An associative subscript on an undefined scalar or on a type object reads as
(Any).my $u; $u<k>andStr<k>are(Any)
More from this test: Containers & assignment (1), Lists & laziness (1), Regexes & grammars (1), Signatures & dispatch (1), Types & coercion (1).
flipflop-and-nil-termRaku++ passesRakudo passes- 4
A bare
Niloperand of a set operator is kept as an element, as aNilinside a list is.Nil (|) 1keeps theNil
More from this test: Operators (2), Syntax & parsing (1).
grand-review-c2-methodsRaku++ passesRakudo passes- 9
Hash.newand.hashgiven an odd number of non-Pair elements die.Hash.new(1, 2, 3)and(1, 2, 3).hashdie
More from this test: I/O & processes (6), Lists & laziness (1), Numerics (4), Everything else (1), Strings & Unicode (3).
hash-classify-list-and-defaultsRaku++ passesRakudo passes- 1
%h.classify-list($mapper, *@values)files the values into the invocant and returns it, and a list-valued key nests.a key
("1a","1b")files under%h<1a><1b> - 2
%h.categorize-listfiles each value under every key the mapper yields.
More from this test: Containers & assignment (1).
hash-map-pair-semantics-sheetRaku++ passesRakudo passes- 1
Storing an odd number of items into a Hash, by assignment,
%( ),Hash.newor.Hash, throws X::Hash::Store::OddNumber, whose.foundcounts two per key stored plus the stray item and whose.lastis the leftover. inferredmy %h = 1, 2, 3throws with.found3 and.last3 - 2
In a list stored into a Hash, a Map merges its pairs as a Hash does, while a Set stays one item used as a key. inferred
my %m = (c => 1, d => 2).Map, e => 3has keys c, d and e - 3
A lone Callable assigned to a Hash dies with a message starting "Cannot use a Callable as the only argument to store in a Hash". inferred
my %h = { $_ }dies - 4
An undefined hash key stringifies to the empty string with a warning, and an undefined topic smartmatched against a Hash is False with a warning. inferred
%h{Any} = 1warns and stores under"" - 5
An object hash keeps its keys as objects of their own type, so
1and"1"are different keys, and a key of the wrong type is refused with X::TypeCheck::Binding::Parameter. inferredfor
my %h{Int} = 1 => "a",%h{1}:existsisTrueand%h<1>:existsisFalse - 6
The
:{ }composer builds an object hash keyed on Mu, whose.rakuis a declaration. inferred:{ 1 => "a" }.rakuis(my Mu %{Mu} = 1 => "a") - 7
An unitemized aggregate used as an object-hash subscript is a slice, not one key. inferred
my %h{Any}; %h{[1, 2]} = "a"makes two entries - 10
Clashing subscript adverbs answer a Failure carrying X::Adverb whose
.nogonames them,:exists:kvand:exists:pare legal, and an unknown adverb on a hash subscript throws X::Adverb. inferred%h<a b>:exists:kis a Failure whose exception.nogois("exists", "k") - 14
A Map is immutable: assigning to a key dies with "Cannot change key 'a' in an immutable Map" or "Cannot add key 'c' to an immutable Map",
:deletedies, binding an element throws X::Bind, and there is no.default. inferredMap.new((a => 1, b => 2))<a> = 2dies withCannot change key 'a' in an immutable Map - 15
A missing key in a Map reads as Nil, in a slice too, and reading it does not create it. inferred
Map.new((a => 1, b => 2))<a z>is(1, Nil) - 17
.containson a Map tests the Map's Str form and warns that it did. inferredMap.new((a => 1)).contains("a")isTruewith a warning - 18
A Hash coerced with
.Setkeeps the keys with truthy values,.Bagkeeps only positive weights, and.Mixkeeps negative weights too. inferred%(a => 0, b => 1).Set.rakuisSet.new("b");%(a => -1, b => 2).Bag.rakuis("b"=>2).Bag - 21
The
pairsub builds a Pair keeping a non-Str key,⇒is the fat arrow, and.antipairkeeps the value's type as the new key. inferredpair(1, 2).rakuis1 => 2;(a => 1).antipair.rakuis1 => "a"
More from this test: Containers & assignment (3), Operators (4), Stringification (5), Types & coercion (1).
hash-new-flatten-and-cool-encodeRaku++ passesRakudo passes- 1
Hash.newflattens its arguments all the way down before pairing them, except that an itemized list does not flatten.Hash.new: @keys Z @valuespairs each key with its value
More from this test: Strings & Unicode (2).
hash-push-append-and-itemised-valuesRaku++ passesRakudo passes- 1
%h.pushand%h.appendfirst flatten their arguments into pairs: a list, Seq or Hash argument contributes its own pairs.(my %inv).push: %wc.invertadds every inverted pair - 2
A named argument to
%h.pushcontributes nothing, so%h.push(e => 6)and%h.push(:c(2))are no-ops. - 3
On a new key both
%h.pushand%h.appendstore the value as it is, only a list value spreading; the two differ only for an existing key.
More from this test: Stringification (1).
hash-store-of-nil-is-oddRaku++ passesRakudo passes- 1
Assigning
Nilto a hash,%h = Nilormy %h = Nil, is the odd-number-of-elements error, becauseNiltakes one slot in a list.my %h = Nilthrows, as%h = 1and%h = (Nil,)do - 2
Assigning to a hash a variable that holds the undefined Any is the odd-number error, reported as "type object 'Any'".
- 3
%(…)and%$xare the.hashcoercion, under which an undefined value gives the empty Hash.%(Any)is an empty Hash
hash-values-map-rw-paramRaku++ passesRakudo passes- 2
Written through
.values, a typed hash's value answers to the hash's type, and a QuantHash's weight set to 0 deletes the key.
More from this test: Containers & assignment (1).
is-deeply-strict-and-anton-batchRaku++ passesRakudo passes- 5
A set operator's result takes the left operand's mutable flavour.
SetHash (|) Setis a SetHash,Set (|) SetHasha Set,SetHash (+) SetHasha BagHash
More from this test: I/O & processes (3), Lists & laziness (1), Classes, roles & the MOP (3), Operators (3), Everything else (1), Regexes & grammars (2), Signatures & dispatch (1), Syntax & parsing (2).
issue-221-array-list-which-identityRaku++ passesRakudo passes- 3
(elem)walks the right-hand list's own elements without flattening it.@b (elem) (@b.item,)is True and2 ∈ (1, (2, 3))is False
More from this test: Lists & laziness (1), Classes, roles & the MOP (1).
issue35-zef-after-installRaku++ passesRakudo cannot run it- 1
for %h -> $phands out Pairs that hold the hash entry's own container, so%h{$p.key} = …in the body shows through$p.value.
More from this test: Containers & assignment (1), I/O & processes (1), Lists & laziness (1), Modules (1), Types & coercion (1).
itemized-list-hash-key-assignRaku++ passesRakudo passesitemized-range-hash-keyRaku++ passesRakudo passes- 1
(1..2).itemis itemized, as$(1..2)is, so it is one hash key in a subscript assignment.%h{(1..2).item} = 1stores one key, "1 2"
keyof-capture-and-cool-subsRaku++ passesRakudo passes- 1
.keyofreports the declared key type of an object hash such asmy %h{Int}, and a plain hash keys on the coercion typeStr(Any).
More from this test: Signatures & dispatch (2), Stringification (1), Strings & Unicode (1).
listop-terms-and-empty-container-failuresRaku++ passesRakudo passes- 3
An object hash declared with a key type and no value type is
Hash[Any, K], so a missing key givesAny, notMu.
More from this test: I/O & processes (1), Lists & laziness (4), Syntax & parsing (2).
lizmat-containers-and-dispatchRaku++ passesRakudo passes- 1
.BIND-KEY($k, $value)binds the element, so it is not writable afterwards, exactly as%h<k> := vdoes.
More from this test: Classes, roles & the MOP (2), Signatures & dispatch (1), Strings & Unicode (1), Syntax & parsing (1).
missing-routines-batchRaku++ passesRakudo passes- 3
The role coercers
.Setty,.Baggyand.Mixygive the immutable member of each QuantHash family.
More from this test: Dates & times (1), Lists & laziness (3), Regexes & grammars (1), Stringification (1), Strings & Unicode (1).
modinfo-ecosystem-clusterRaku++ passesRakudo passes- 6
.Hashon a Hash or on a Map returns a Hash.%h.Map.Hashis{a => 1}
More from this test: I/O & processes (1), Lists & laziness (1), Operators (1), Regexes & grammars (3), Scoping & phasers (2), Signatures & dispatch (3), Syntax & parsing (7), Types & coercion (1).
object-hash-copy-keeps-keysRaku++ passesRakudo passes- 1
An object hash assigned into another object hash keeps its keys as the objects they were.
after
my %copy{HashKey} = %original, a key of%copyis the object, not the Str "(HashKey)"
object-hash-keysRaku++ passesRakudo passes- 1
An object hash
my %h{Int}keeps keys of its declared key type: a stored key reads back as anInt, and.rakushows typed keys.after
%h{+$k} = 66the key is the Int 33, not the Str "33"
More from this test: divergences (1).
only-ellipsis-bracketed-infixRaku++ passesRakudo passesMore from this test: Operators (2), Signatures & dispatch (1), Syntax & parsing (1).
pair-as-key-value-and-patternRaku++ passesRakudo passes- 1
A
Pairis Associative on its one key:$p<a>is the value,$p<a>:existsis True, and any other key givesNil.
More from this test: Operators (2), Stringification (2).
pair-subscript-nativeRaku++ passesRakudo passes- 1
$p<a>on a Pair whose key isareads the Pair's value.
More from this test: Containers & assignment (1), Signatures & dispatch (1).
pointy-block-for-modifierRaku++ passesRakudo passes- 5
Iterating a hash's
.kvgives keys without a container and values with one, so-> $k, $v is rwwrites through to the hash's values.
More from this test: Signatures & dispatch (3), Syntax & parsing (1).
quanthash-coerce-flattenRaku++ passesRakudo passes- 1
The quanthash coercers (
.Bag,.Set, …) flatten one level through aList—(@a, %h).Bagtakes@a's elements and%h's pairs — but anArray's itemized elements stay whole.[4,[5,6]].Bagkeeps[5,6]as one key
quanthash-exact-sethash-zen-dynamicRaku++ passesRakudo passes- 1
Rat weights merged in a
Mixare summed exactly.weights 1/10 and 1/50 for one key total
0.12, not0.12000000000000001 - 2
.setand.unsetexist only onSetHash(Set.^canandBagHash.^canare both False), take one possibly-listy positional, and returnNil. - 3
An empty
<>zen slice accepts subscript adverbs such as:k,:vand:kv.%h<>:kgives the hash's keys
More from this test: Scoping & phasers (1).
quanthash-not-mapRaku++ passesRakudo passes- 1
A
Set,Bag,Mix,SetHash,BagHashorMixHashdoesAssociativebut is not aMap: it neither smartmatchesMapnor binds to aMap $mparameter.
More from this test: Types & coercion (2).
quantifier-modifiers-and-anon-methodsRaku++ passesRakudo passes- 3
Assigning a list to an angle-word slice of a SetHash is a list assignment in which each key follows the quanthash rule: False removes, True adds.
$sh<a b> = False, Trueremovesaand addsb
More from this test: Classes, roles & the MOP (1), Regexes & grammars (1).
rak-chain-install-gapsRaku++ passesRakudo passes- 5
$x := %h<k>:deletedeletes the key and binds the deleted value.
More from this test: Concurrency (1), Classes, roles & the MOP (1), Signatures & dispatch (1), Types & coercion (2).
rakudo-t-language-gaps-2Raku++ passesRakudo passes- 3
Hashes compare with
cmpas their sorted pairs.
More from this test: Compile-time errors (1), Exceptions & control flow (2), Lists & laziness (2), Operators (2), Regexes & grammars (4), Scoping & phasers (1), Signatures & dispatch (1), Syntax & parsing (1).
rakuglaze-round-4Raku++ passesRakudo passes- 7
A value read from an object hash does not carry its key into another hash it is stored in.
- 8
Hash.pushstores a Slip value as it is, and slips it into an Array already under the key. inferred
More from this test: Exceptions & control flow (4), Lists & laziness (1), Classes, roles & the MOP (1), Operators (1), Scoping & phasers (1), Signatures & dispatch (1), Types & coercion (2).
rakuglaze-round-6Raku++ passesRakudo passes- 8
Prefix
|slips a hash held in a$variable. - 9
.Hashon a hash held in a$variable returns it without its item container.
More from this test: Concurrency (1), Exceptions & control flow (1), I/O & processes (1), Lists & laziness (2), Classes, roles & the MOP (1), Regexes & grammars (1), Scoping & phasers (1), Syntax & parsing (2).
range-is-the-set-of-its-elementsRaku++ passesRakudo passes- 1
Set membership coerces a Range to the Set of the values it iterates, so a value that merely lies between the endpoints is not a member.
½ ∈ ^2is not True - 2
As a set operand an Int Range holds the Ints between its ends, and anything that is an Int (
True, the allomorph<1>) is a member. - 3
An endless Range used as a set operand is refused as lazy.
repl-sandbox-and-capture-scopingRaku++ passesRakudo passes- 6
Hash(%a, %b, %c)merges all its arguments, and a Hash element in a list being made into a Hash contributes its pairs.
More from this test: Compile-time errors (1), Regexes & grammars (4).
roast-3log-batch1Raku++ passesRakudo passes- 7
Pair.freezekeeps the Pair's identity.
More from this test: Dates & times (1), Exceptions & control flow (2), I/O & processes (3), Lists & laziness (2).
roast-sweep-runtimeRaku++ passesRakudo cannot run it- 10
A Hash store puts each value in a Scalar container, and a Map's values have none. inferred
- 12
deepmapover a Hash drops a key whose block returnsEmpty. inferred - 16
.valueshands out a hash's own containers, so amapthat assigns to$_writes through, and a QuantHash drops a key whose weight becomes 0 that way. inferred - 30
A Junction that a
classifyclassifier returns is one key of the result, looked up as itself. inferred
More from this test: Compile-time errors (4), Concurrency (2), Containers & assignment (2), Exceptions & control flow (2), I/O & processes (3), Lists & laziness (5), Modules (2), Classes, roles & the MOP (8), Operators (4), Everything else (1), Regexes & grammars (1), Scoping & phasers (14), Stringification (1), Strings & Unicode (1), Types & coercion (3).
set-iterates-pairsRaku++ passesRakudo passes- 1
A Set iterates as Pairs
elem => True:for,.list,.map,.grep,.sort,.firstand.joinall see the pairs.for set(3)sees3 => True
More from this test: Lists & laziness (1).
set-op-assign-starts-emptyRaku++ passesRakudo passes- 1
A set or bag operator op-assigned to an undefined target starts from its identity:
set()for ∪ ∩ ∖ ⊖ and their ASCII forms,bag()for ⊎ and ⊍.my $s; $s ∪= 0holds only 0, notSet.new(Any, 0) - 2
A set or bag operator reduced over nothing answers its identity,
set()orbag().[∪] ()isset()and[⊎] ()isbag()
set-ops-reduce-max-adverbsRaku++ passesRakudo passes- 1
A plain list is treated as a Set in a set operation, so a repeated element counts once.
(1,2,2,3) (-) (2,)isSet(1 3);(1,1,2) (==) (1,2)is True - 4
:k/:v/:kv/:pon.max/.minof an Associative answer in terms of the mapping, where on a Positional:kis the index.%h.max(:v)is the largest value and%h.max(:k)its key
More from this test: Lists & laziness (1), Operators (2).
slices-trans-and-exact-sequencesRaku++ passesRakudo passes- 1
A subscript that is a call is a slice when the call returns a list, and a single-key subscript when it returns one value.
%orig{ %new.keys } = %new.valuesassigns key by key - 3
A
Pairis one element whose.keysis its key, not the index 0. - 4
A
Pairwhose value is a Hash inverts to one pair per entry of that hash.
More from this test: Lists & laziness (1), Regexes & grammars (1), Strings & Unicode (2), Syntax & parsing (1).
splice-rotor-rettype-and-placeholdersRaku++ passesRakudo passes- 5
.Hashand.Mapon a Pair give the one-entry hash it describes.
More from this test: Lists & laziness (1), Signatures & dispatch (1), Strings & Unicode (1).
str-range-consumersRaku++ passesRakudo passes- 3
A
Rangeused as the key of aPairis kept as aRange, not stringified.('A'..'C' => 1).keyis the Range, not the Str "A B C"
More from this test: Stringification (1), Strings & Unicode (1).
top100-chunk-c-b1-2026-09-03Raku++ passesRakudo does not pass- 1
A Junction used as a Pair key in a hash initialiser autothreads: the value is stored under each eigenstate.
my %h = ("a"|"b") => 1, "c" => 2has 3 keys with%h<a> == 1and%h<b> == 1
More from this test: Modules (1), Classes, roles & the MOP (1).
tries-with-frequenciesRaku++ passesRakudo passes- 4
%h.push: ($k, $v)pairs consecutive non-Pair items up as key and value.
More from this test: Lists & laziness (2), Classes, roles & the MOP (1), Operators (2), Signatures & dispatch (1).
typed-hash-pair-value-checks-typeRaku++ passesRakudo passes- 1
Assigning to
.valueof a Pair taken from a typed hash (via.map,.pairs,for %hor%h.pairs[0]) is checked against the hash's element type and throwsX::TypeCheck::Assignmenton a mismatch, as%h<k> = …does.my Int %h = :42foo; %h.map: { .value = 'meows' }throws X::TypeCheck::Assignment
value-identityRaku++ passesRakudo passes- 1
Two distinct instances of a class are distinct elements of a Set or Bag.
set($x, $y).elemsis 2 for two instances of one class
More from this test: Numerics (1), Operators (1), Types & coercion (3).
whatever-value-pair-keyRaku++ passesRakudo passes- 1
A Whatever held in a variable keeps its type as a Pair's key.
my $w = *; ($w => 1).rakuis* => 1, and.key === $wholds
which-identity-and-set-op-elementsRaku++ passesRakudo passes- 2
The result of a set operator keeps its elements with their original types, not their string keys.
set(1,2) ∪ set(2,3)holds the Ints 1, 2, 3, notSet.new("1","2","3")
More from this test: Types & coercion (1).
zef-load-fixesRaku++ passesRakudo passes- 1
@%hand@$hashgive the hash's Pairs as a list, not the hash as a single element.for @$node -> $sub-nodeiterates the pairs
More from this test: Classes, roles & the MOP (1), Syntax & parsing (1).