Skip to content

Commit a7c52cd

Browse files
committed
Clarification about @*ARGS closes #2790
1 parent 098f2c4 commit a7c52cd

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

doc/Language/variables.pod6

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ declaration of the variable. Assuming we have a C<FailHash> class:
5656
class FailHash is Hash {
5757
has Bool $!final = False;
5858
multi method AT-KEY ( ::?CLASS:D: Str:D \key ){
59-
fail X::OutOfRange.new(:what("Hash key"), :got(key), :range(self.keys)) if $!final && !self.EXISTS-KEY(key);
59+
fail X::OutOfRange.new(:what("Hash key"), :got(key),
60+
:range(self.keys)) if $!final && !self.EXISTS-KEY(key);
6061
callsame # still not final, so do normal action from Hash
6162
}
6263
@@ -94,8 +95,8 @@ Item assignment places the value from the right-hand side into the variable
9495
9596
List assignment leaves the choice of what to do to the variable on the left.
9697
97-
For example, L<Array|/type/Array> variables (C<@> sigil) empty themselves on list
98-
assignment and then put all the values from the right-hand side into
98+
For example, L<Array|/type/Array> variables (C<@> sigil) empty themselves on
99+
list assignment and then put all the values from the right-hand side into
99100
themselves.
100101
101102
The type of assignment (item or list) is decided by the first context
@@ -799,7 +800,8 @@ array.
799800
800801
=head3 The C<%> variable
801802
802-
In addition, there's an L<Associative|/type/Associative> anonymous state variable C<%>.
803+
In addition, there's an L<Associative|/type/Associative> anonymous state
804+
variable C<%>.
803805
804806
sub foo($x) {
805807
say (%).push($x => $x);
@@ -932,7 +934,8 @@ L<of|/type/Variable#trait_of> to set a type constraint.
932934
my Int $x = 42;
933935
$x = 'a string';
934936
CATCH { default { put .^name, ': ', .Str } }
935-
# OUTPUT: «X::TypeCheck::Assignment: Type check failed in assignment to $x; expected Int but got Str ("a string")␤»
937+
# OUTPUT: «X::TypeCheck::Assignment: Type check failed in assignment to $x;
938+
expected Int but got Str ("a string")␤»
936939
937940
If a scalar variable has a type constraint but no initial value, it's
938941
initialized with the type object of the default value of the container it's
@@ -961,8 +964,9 @@ re-applied by assigning C<Nil> to it:
961964
962965
=head2 Default defined variables pragma
963966
964-
To force all variables to have a L<definiteness|/language/mop#index-entry-syntax_DEFINITE-DEFINITE>
965-
constraint, use the pragma C<use variables :D>. The pragma is lexically scoped and can be
967+
To force all variables to have a
968+
L<definiteness|/language/mop#index-entry-syntax_DEFINITE-DEFINITE> constraint,
969+
use the pragma C<use variables :D>. The pragma is lexically scoped and can be
966970
switched off with C<use variables :_>.
967971
968972
=begin code :skip-test<compile-time error>
@@ -1267,7 +1271,7 @@ for examples and more context.
12671271
12681272
=head4 C<@*ARGS>
12691273
1270-
C<@*ARGS> contains the arguments from the command line.
1274+
C<@*ARGS> is an array of C<Str> containing the arguments from the command line.
12711275
12721276
X<|&*ARGS-TO-CAPTURE>
12731277
=head4 C<&*ARGS-TO-CAPTURE>
@@ -1329,8 +1333,8 @@ in your program.
13291333
X<|$*TZ>
13301334
=head4 C<$*TZ>
13311335
1332-
C<$*TZ> contains the system's local time zone offset, as the number of B<seconds>
1333-
from GMT.
1336+
C<$*TZ> contains the system's local time zone offset, as the number of
1337+
B<seconds> from GMT.
13341338
13351339
X<|$*CWD>
13361340
=head4 C<$*CWD>
@@ -1515,13 +1519,14 @@ C<1e-15>.
15151519
X<|$*THREAD>
15161520
=head4 C<$*THREAD>
15171521
1518-
Contains a L<Thread|/type/Thread> object representing the currently executing thread.
1522+
Contains a L<Thread|/type/Thread> object representing the currently executing
1523+
thread.
15191524
15201525
X<|$*SCHEDULER>
15211526
=head4 C<$*SCHEDULER>
15221527
1523-
This is a L<ThreadPoolScheduler|/type/ThreadPoolScheduler> object representing the current default
1524-
scheduler.
1528+
This is a L<ThreadPoolScheduler|/type/ThreadPoolScheduler> object representing
1529+
the current default scheduler.
15251530
15261531
By default this imposes a maximum of 64 threads on the methods C<.hyper>,
15271532
C<.race> and other thread-pool classes that use that scheduler such as

0 commit comments

Comments
 (0)