You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/Language/variables.pod6
+41-33Lines changed: 41 additions & 33 deletions
Original file line number
Diff line number
Diff line change
@@ -1102,7 +1102,6 @@ L<Sub|/type/Sub> attached to the current routine. It does support the method
1102
1102
C<.name> to obtain the name of the called routine, as well as C<.signature> and
1103
1103
others method related to C<Sub>:
1104
1104
1105
-
1106
1105
sub awesome-sub { say &?ROUTINE.name }
1107
1106
awesome-sub # OUTPUT: awesome-sub
1108
1107
@@ -1117,7 +1116,7 @@ sub do-work {
1117
1116
do-work;
1118
1117
=endcode
1119
1118
1120
-
=head3X<&?BLOCK|&?BLOCK>
1119
+
=head3X<&?BLOCK>
1121
1120
1122
1121
The special compile variable C<?&BLOCK> behaves similarly to
1123
1122
C<?&ROUTINE> but it allows to introspect a single block of code.
@@ -1140,26 +1139,25 @@ for '.' {
1140
1139
1141
1140
1142
1141
All dynamically scoped variables have the C<*> twigil, and their name is written
1143
-
uppercase.
1142
+
in uppercase.
1144
1143
1145
1144
X<|$*ARGFILES>X<|@*ARGS>
1146
1145
=head3Argument related variables
1147
1146
1148
-
=itemC<$*ARGFILES>
1149
-
An L<IO::ArgFiles> (an empty subclass of L<IO::CatHandle>)
1150
-
that uses C<@*ARGS> as source files, if
1151
-
it contains any files, or C<$*IN> otherwise. When C<$*IN>
1152
-
is used, its C<:nl-in>, C<:chomp>, C<:encoding>,
1153
-
and C<:bin> will be set on the L<IO::ArgFiles> object.
1147
+
=itemC<$*ARGFILES> An L<IO::ArgFiles> (an empty subclass of L<IO::CatHandle>)
1148
+
that uses C<@*ARGS> as source files, if it contains any files, or C<$*IN>
1149
+
otherwise. When C<$*IN> is used, its C<:nl-in>, C<:chomp>, C<:encoding>, and
1150
+
C<:bin> will be set on the L<IO::ArgFiles> object.
1154
1151
1155
1152
=itemC<@*ARGS>
1156
1153
Arguments from the command line.
1157
1154
1158
1155
X<|$*IN>X<|$*OUT>X<|$*ERR>
1159
1156
=head3Special File Handles: STDIN, STDOUT and STDERR
1160
1157
1161
-
For more information about special filehandles please see also
1162
-
the L<Input and Output|/language/io> page and the L<IO::Special> class. L<IO::Handle> contains several examples of using C<$*IN> for reading standard input.
1158
+
For more information about special filehandles please see also the L<Input and
1159
+
Output|/language/io> page and the L<IO::Special> class. L<IO::Handle> contains
1160
+
several examples of using C<$*IN> for reading standard input.
1163
1161
1164
1162
1165
1163
=itemC<$*IN>
@@ -1233,10 +1231,9 @@ X<|$*PROGRAM>
1233
1231
location (in the form of an C<IO::Path> object) of the Perl program being executed;
1234
1232
1235
1233
X<|$*EXIT>
1236
-
=itemC<&*EXIT>
1237
-
code that will be executed when doing an exit(). Intended
1238
-
to be used in situations where Perl 6 is embedded in
1239
-
another language runtime (such as Inline::Perl6 in Perl 5);
1234
+
=itemC<&*EXIT> code that will be executed when doing an exit(). Intended to
1235
+
be used in situations where Perl 6 is embedded in another language runtime
1236
+
(such as Inline::Perl6 in Perl 5);
1240
1237
1241
1238
X<|$*EXECUTABLE>
1242
1239
=itemC<$*EXECUTABLE>
@@ -1258,23 +1255,23 @@ C<sub MAIN> and C<sub USAGE>. The variable is I<read-only>;
1258
1255
X<|$*USER>
1259
1256
=itemC<$*USER>
1260
1257
the user that is running the program. It's an object
1261
-
that evaluates to "username (uid)". It will evaluate
1258
+
that evaluates to C<username (uid)>. It will evaluate
1262
1259
to the username only if treated as a string and the
1263
1260
numeric user id if treated as a number;
1264
1261
1265
1262
X<|$*GROUP>
1266
1263
=itemC<$*GROUP>
1267
1264
the primary group of the user who is running the program.
1268
-
It's an object that evaluates to "groupname (gid)".
1265
+
It's an object that evaluates to C<groupname (gid)>.
1269
1266
It will evaluate to the groupname only if treated as a
1270
1267
string and the numeric group id if treated as a number;
1271
1268
1272
1269
X<|$*HOME>
1273
1270
=itemC<$*HOME>
1274
1271
an L<IO::Path> object representing the "home directory"
1275
1272
of the user that is running the program. Uses
1276
-
C«%*ENV<HOME>» if set. On Windows, uses
1277
-
C«%*ENV<HOMEDRIVE> ~ %*ENV<HOMEPATH>». If the
1273
+
C«%*ENV<HOME>» if set. On Windows, uses
1274
+
C«%*ENV<HOMEDRIVE> ~ %*ENV<HOMEPATH>». If the
1278
1275
home directory cannot be determined, it will be L<Any>;
1279
1276
1280
1277
X<|$*SPEC>
@@ -1299,18 +1296,19 @@ X<|$*SCHEDULER>
1299
1296
a L<ThreadPoolScheduler> object representing the current default scheduler (see note below);
1300
1297
1301
1298
X<|$*SAMPLER>
1302
-
=itemC<$*SAMPLER>
1303
-
the current L<Telemetry::Sampler> used for making
1304
-
snapshots of system state. Only available if
1305
-
L<Telemetry> has been loaded.
1299
+
=itemC<$*SAMPLER>: the current L<Telemetry::Sampler> used for
1300
+
making snapshots of system state. Only available if L<Telemetry> has been
1301
+
loaded.
1306
1302
1307
1303
1308
1304
Note on usage of C<$*SCHEDULER>:
1309
1305
1310
-
For the current (2018.04) Rakudo, by default this imposes a maximum of 64 threads on the methods
1311
-
C<.hyper>, C<.race> and other thread-pool classes that use that scheduler such as C<Promise>s or C<Supplie>s. To change the maximum number of threads, you can either set the
1312
-
environment variable C<RAKUDO_MAX_THREADS> before running perl6 or create a scoped copy
1313
-
with the default changed before using them:
1306
+
For the current (2018.04) Rakudo, by default this imposes a maximum of 64
1307
+
threads on the methods C<.hyper>, C<.race> and other thread-pool classes that
1308
+
use that scheduler such as C<Promise>s or C<Supplie>s. To change the maximum
1309
+
number of threads, you can either set the environment variable
1310
+
C<RAKUDO_MAX_THREADS> before running perl6 or create a scoped copy with the
1311
+
default changed before using them:
1314
1312
1315
1313
my $*SCHEDULER = ThreadPoolScheduler.new( max_threads => 128 );
1316
1314
@@ -1322,17 +1320,27 @@ It is helpful to know our naming conventions in order to understand what codes
1322
1320
do directly. However, there is not yet a conventions list covering anywhere.
1323
1321
Still we list several conventions that are widely held.
1324
1322
1325
-
=item1Subs and methods from the built-ins library try to have single-word names when a good one could be found. In cases where there are two or more words making up a name, they are separated by a "-".
1323
+
=item1Subs and methods from the built-ins library try to have single-word names
1324
+
when a good one could be found. In cases where there are two or more words
1325
+
making up a name, they are separated by a "-".
1326
1326
1327
-
=item1Compounds are treated as a single word, thus C<substr>, C<subbuf>, and C<deepmap> (just like we write "starfish", not "star fish" in English).
1327
+
=item1Compounds are treated as a single word, thus C<substr>, C<subbuf>, and
1328
+
C<deepmap> (just like we write "starfish", not "star fish" in English).
1328
1329
1329
-
=item1Subs and methods that are automatically called for you at special times are written in uppercase. This includes the C<MAIN> sub, the C<AT-POS> and related methods for implementing container types, along with C<BUILD> and C<DESTROY>.
1330
+
=item1Subs and methods that are automatically called for you at special times
1331
+
are written in uppercase. This includes the C<MAIN> sub, the C<AT-POS> and
1332
+
related methods for implementing container types, along with C<BUILD> and
1333
+
C<DESTROY>.
1330
1334
1331
-
=item1Type names are camel case, except for native types, which are lowercase. For the exception, you can remember it by: they are stored in a more compact way, so they names look smaller too.
1335
+
=item1Type names are camel case, except for native types, which are lowercase.
1336
+
For the exception, you can remember it by: they are stored in a more compact
1337
+
way, so they names look smaller too.
1332
1338
1333
-
=item1Built-in dynamic variables and compile-time variables are always uppercase, such like C<$*OUT>, C<$?FILE>.
1339
+
=item1Built-in dynamic variables and compile-time variables are always
1340
+
uppercase, such like C<$*OUT>, C<$?FILE>.
1334
1341
1335
-
=item1Methods from the MOP and other internals use "_" to separate multiple words, such like C<add_method>.
1342
+
=item1Methods from the MOP and other internals use "_" to separate multiple
0 commit comments