Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Document Zen slicing a Seq caches it
  • Loading branch information
zoffixznet committed Oct 19, 2018
1 parent d4add06 commit 13f79b9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions doc/Language/subscripts.pod6
Expand Up @@ -320,8 +320,12 @@ object) or an empty list (which returns an empty slice):
say %bag{*}; # OUTPUT: «(1 3)␤»
say %bag{()}; # OUTPUT: «()␤»
It is usually used to L<interpolate|/language/quoting#Interpolation:_qq>
entire arrays / hashes into strings:
Zen slicing does not
L<reify|/language/glossary#index-entry-Reify> and for L<List> type merely
returns the object. It is usually used to
L<interpolate|/language/quoting#Interpolation:_qq> entire arrays / hashes into strings.
For L<Seq> type, Zen slice is equivalent to calling a Zen slice on return value
of L<cache>.
my @words = "cruel", "world";
say "Hello, @words[]!" # OUTPUT: «Hello, cruel world!␤»
Expand Down

0 comments on commit 13f79b9

Please sign in to comment.