File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -314,14 +314,14 @@ not. The C<s///> operator works on a variable, into which it puts a newly
314
314
created string object. Likewise, C < $i++ > works on the C < $i > variable, not
315
315
just on the value in it.
316
316
317
- Knowing this, you would not try to change a literal string (e.g. like
317
+ Knowing this, you would not try to change a literal string (e.g. like
318
318
C < 'hello' ~~ s/h/H/; #doesn't work > ), but you might accidentally do
319
319
something equivalent using `map`:
320
320
321
321
my @foo = <hello world>.map: { s/h/H/ }; # dies with
322
322
# Cannot modify an immutable Str (hello)
323
323
324
- my @bar = <hello world>».subst-mutate: 'h', 'H'; # dies with
324
+ my @bar = <hello world>».subst-mutate: 'h', 'H'; # dies with
325
325
# Cannot resolve caller subst-mutate(Str: Str, Str);
326
326
# the following candidates match the type but require
327
327
# mutable arguments: ...
@@ -331,7 +331,7 @@ the the original in place:
331
331
332
332
my @foo = <hello world>.map: { S/h/H/ }; # ['Hello','world']
333
333
my @bar = <hello world>».subst: 'h', 'H'; # ['Hello','world']
334
-
334
+
335
335
See the documentation on L < containers|/language/containers > for more
336
336
information.
337
337
You can’t perform that action at this time.
0 commit comments