Skip to content

Commit f1e4977

Browse files
authored
Document .subst-mutate will be deprecated in future
Originally planned[^1] to be deprecated in 6.d for reasons[^1], but due to R#1289 [^2] we're postponing it for later language versions. [^1] https://github.com/perl6/6.d-prep/blob/master/TODO/FEATURES.md#deprecate-strsubst-mutate [^2] rakudo/rakudo#1289
1 parent 83dcfc4 commit f1e4977

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

doc/Type/Str.pod6

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -862,9 +862,7 @@ Returns the invocant string where C<$matcher> is replaced by C<$replacement>
862862
863863
There is an in-place syntactic variant of C<subst> spelled
864864
L«C<s/matcher/replacement/>|/syntax/s$SOLIDUS%20$SOLIDUS%20$SOLIDUS» and with
865-
adverb following the C<s> or inside the matcher, as well as the
866-
L«C<.subst-mutate> method|/routine/subst-mutate» which modifies the string
867-
in-place.
865+
adverb following the C<s> or inside the matcher.
868866
869867
C<$matcher> can be a L<Regex>, or a literal C<Str>. Non-Str matcher arguments
870868
of type L<Cool> are coerced to C<Str> for literal matching.
@@ -948,6 +946,11 @@ The C<:nth> adverb has readable English-looking variants:
948946
949947
=head2 method subst-mutate
950948
949+
B<NOTE:> I<<< C<.subst-mutate> will be deprecated in future language
950+
versions. You can use L<subst> with
951+
L«C<.=> method call assignment operator|/routine/.=.html» or
952+
L«C<s///> substitution operator|/syntax/s$SOLIDUS$SOLIDUS$SOLIDUS» instead. >>>
953+
951954
Where L<subst> returns the modified string and leaves the original
952955
unchanged, it is possible to mutate the original string by using
953956
C<subst-mutate>. If the match is successful, the method returns a L<Match>

0 commit comments

Comments
 (0)