Skip to content

Commit cc34198

Browse files
committed
Adds example for multi-dim {} slicing closes #2436
1 parent 8a61a9c commit cc34198

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

doc/Language/create-cli.pod6

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ X<|ARGS-TO-CAPTURE>
298298
The C<ARGS-TO-CAPTURE> subroutine should accept two parameters: a L<Callable>
299299
representing the C<MAIN> unit to be executed (so it can be introspected if
300300
necessary) and an array with the arguments from the command line. It
301-
should return a L<Capture|/type/Capture> object that should be used to
301+
should return a L<Capture|/type/Capture> object that will be used to
302302
dispatch the C<MAIN> unit. A B<very> contrived example that will create
303303
a C<Capture> depending on some keyword that was entered (which can be handy
304304
during testing of a command line interface of a script):
@@ -334,7 +334,7 @@ ecosystem.
334334
X<|GENERATE-USAGE>
335335
=head2 sub GENERATE-USAGE
336336
337-
The C<GENERATE-USAGE> subroutine should accept a Callable representing the
337+
The C<GENERATE-USAGE> subroutine should accept a C<Callable> representing the
338338
C<MAIN> subroutine that didn't get executed because the dispatch failed.
339339
This can be used for introspection. All the other parameters are the
340340
parameters that were set up to be sent to C<MAIN>. It should return the
@@ -348,7 +348,7 @@ arguments:
348348
!! &*GENERATE-USAGE(&main, |capture)
349349
}
350350
351-
You can also use multi subroutine to create the same effect:
351+
You can also use multi subroutines to create the same effect:
352352
353353
multi sub GENERATE-USAGE(&main, :$foo!) {
354354
"You're not allowed to specify a --foo"
@@ -376,7 +376,7 @@ called if a C<MAIN> subroutine was found in the mainline of a program.
376376
377377
This interface was never documented. However, any programs using this
378378
undocumented interface will continue to function until C<v6.e>. From v6.d
379-
onward, the use of the undocumented API will cause a DEPRECATED message.
379+
onward, the use of the undocumented API will cause a C<DEPRECATED> message.
380380
381381
Ecosystem modules can provide both the new and the old interface for
382382
compatibility with older versions of Perl 6: if a newer Perl 6 recognizes

doc/Language/subscripts.pod6

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,12 @@ elements and dimensions.
346346
say @twodim[0,1;1]; # 2nd element of both lists
347347
# OUTPUT: «(b 2)␤»
348348
349+
my %pantheon = %('Baldr' => 'consort' => 'Nanna' ,
350+
'Bragi' => 'consort' => 'Iðunn' ,
351+
'Nótt' => 'consort' => 'Dellingr' );
352+
say %pantheon{'Bragi','Nótt';'consort'; # 'consort' value for both keys
353+
# OUTPUT: «(Iðunn Dellingr)␤»
354+
349355
X<|flattening ;>
350356
351357
Multidimensional subscripts can be used to flatten nested lists when combined

0 commit comments

Comments
 (0)