Skip to content

Commit eb0c969

Browse files
committed
[6.d] Document $*ARGFILES being fed by $*IN inside MAIN
Even when @*ARGS has stuff up in it. Rakudo impl: rakudo/rakudo@84d45f07fb Propspec: Raku/roast@88499ac366
1 parent 342466f commit eb0c969

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

doc/Language/variables.pod6

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,6 +1169,10 @@ that uses C<@*ARGS> as source files, if it contains any files, or C<$*IN>
11691169
otherwise. When C<$*IN> is used, its C<:nl-in>, C<:chomp>, C<:encoding>, and
11701170
C<:bin> will be set on the L<IO::ArgFiles> object.
11711171
1172+
As of 6.d language, C<$*ARGFILES> I<inside>
1173+
L<C«sub MAIN»|/language/functions#sub_MAIN> is always set to C<$*IN>, even
1174+
when C<@*ARGS> is not empty.
1175+
11721176
=item C<@*ARGS>
11731177
Arguments from the command line.
11741178

doc/Type/IO/ArgFiles.pod6

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ All the functionality is inherited from L<IO::CatHandle>.
1515
1616
This class is the magic behind the C<$*ARGFILES> variable. This variable
1717
provides a way to iterate over files passed in to the program on the command
18-
line. Thus the examples above can be simplified like so:
18+
line (i.e. elements of L<C«@*ARGS»|/language/variables#index-entry-%40%2AARGS>).
19+
Thus the examples above can be simplified like so:
1920
2021
use v6.c;
2122
@@ -45,6 +46,10 @@ will then give the output
4546
=for code :skip-test
4647
Shall I compare thee to a summer's day?
4748
49+
As of 6.d language, C<$*ARGFILES> I<inside>
50+
L<C«sub MAIN»|/language/functions#sub_MAIN> is always set to C<$*IN>, even
51+
when C<@*ARGS> is not empty.
52+
4853
=end pod
4954

5055
# vim: expandtab shiftwidth=4 ft=perl6

0 commit comments

Comments
 (0)