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: doc/Language/hashmap.pod6
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ By default, any object declared with the C<%> sigil will get the Associative
16
16
role, and will by default behave like a hash, but this role will only provide
17
17
the two methods above, as well as the default Hash behavior.
18
18
19
-
say (%).^name ;# OUTPUT: «Hash»
19
+
say (%).^name ;# OUTPUT: «Hash»
20
20
21
21
Inversely, you cannot use the C<%> sigil if the C<Associative> role is not mixed
22
22
in, but since this role does not have any associated properties, you will have
@@ -66,7 +66,7 @@ say %logger<2018-04-22>:exists; # OUTPUT: «False»
66
66
=endcode
67
67
68
68
In this case, we are defining a logger with Associative semantics that would be
69
-
able to use dates (or a part of them) as keys. Since we are parametrizing
69
+
able to use dates (or a part of them) as keys. Since we are parameterizing
70
70
C<Associative> to those particular classes, C<of> will return the value type we
71
71
have used, C<Cool> in this case (we can log lists or strings only). Mixing the C<Associative> role gives it the right to use the C<%> sigil; binding is needed in the definition since C<%>-sigilled variables get by default the C<Hash> type.
72
72
@@ -173,7 +173,7 @@ my %h = e => f => 'g';
173
173
174
174
This, however, will effectively define a nested hash:
175
175
176
-
m: my %h = e => { f => 'g'};
176
+
my %h = e => { f => 'g'};
177
177
say %h<e>.^name; # OUTPUT: «Hash»
178
178
say %h<e><f>; # OUTPUT: «g»
179
179
@@ -260,7 +260,7 @@ instead:
260
260
Note: Rakudo implementation currently erroneously applies L<the same
261
261
rules|/routine/{ }#(Operators)_term_{_}> for C<:{ }> as it does for C<{ }> and
262
262
can construct a L<Block> in certain circumstances. To avoid that, you can
263
-
instantiate a parameterized Hash directly. Parameterization of C<%>-sigiled
263
+
instantiate a parameterized Hash directly. Parameterization of C<%>-sigilled
264
264
variables is also supported:
265
265
266
266
my Num %foo1 = "0" => 0e0; # Str keys and Num values
0 commit comments