Skip to content

Commit 843ad42

Browse files
authored
Merge pull request #3244 from tbrowder/p6toraku-variables
chg p6 to raku; chg '.perl' to '.raku'
2 parents 8f612b4 + 4f6c996 commit 843ad42

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

doc/Language/variables.pod6

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,15 @@ List C<(42, "str")> is list-assigned to C<@array>:
162162
163163
my @array;
164164
@array = my $num = 42, "str"; # parsed as @array = ( (my $num = 42), "str )
165-
say @array.perl; # OUTPUT: «[42, "str"]␤» (an Array)
166-
say $num.perl; # OUTPUT: «42␤» (a Num)
165+
say @array.raku; # OUTPUT: «[42, "str"]␤» (an Array)
166+
say $num.raku; # OUTPUT: «42␤» (a Num)
167167
168168
Here's a variant:
169169
170170
my ( @foo, $bar );
171171
@foo = ($bar) = 42, "str"; # parsed as @foo = ( $bar = (42, "str") )
172-
say $bar.perl; # OUTPUT: «$(42, "str")␤» (a List)#
173-
say @foo.perl; # OUTPUT: «[(42, "str"),]␤» (an Array)
172+
say $bar.raku; # OUTPUT: «$(42, "str")␤» (a List)#
173+
say @foo.raku; # OUTPUT: «[(42, "str"),]␤» (an Array)
174174
175175
In this case, the list contextualizer C<( )> puts C<$bar> in a list context, and
176176
thus triggers a list assignment to the Scalar variable C<$bar>. This means that
@@ -206,10 +206,10 @@ Sigilless variables do not enforce L<context|/language/contexts>, so they can be
206206
used to pass something on as-is:
207207
208208
sub logged(&f, |args) {
209-
say('Calling ' ~ &f.name ~ ' with arguments ' ~ args.perl);
209+
say('Calling ' ~ &f.name ~ ' with arguments ' ~ args.raku);
210210
my \result = f(|args);
211211
# ^^^^^^^ not enforcing any context here
212-
say(&f.name ~ ' returned ' ~ result.perl);
212+
say(&f.name ~ ' returned ' ~ result.raku);
213213
return |result;
214214
}
215215
@@ -459,7 +459,7 @@ following are useful:
459459
X<|$~MAIN>X<|$~Quote>X<|$~Quasi>X<|$~Regex>X<|$~Trans>X<|$~P5Regex>
460460
461461
=begin table
462-
$~MAIN the current main language (e.g. Perl statements)
462+
$~MAIN the current main language (e.g., Raku statements)
463463
$~Quote the current root of quoting language
464464
$~Quasi the current root of quasiquoting language
465465
$~Regex the current root of regex language
@@ -609,7 +609,7 @@ elements are left will result in undefined values according to the type of the
609609
variables.
610610
611611
my (Str $a, Str $b, Int $c) = <a b>;
612-
say [$a, $b, $c].perl;
612+
say [$a, $b, $c].raku;
613613
# OUTPUT: «["a", "b", Int]␤»
614614
615615
To destructure a list into a single value, create a list literal with one
@@ -618,13 +618,13 @@ parentheses around a single variable is sufficient.
618618
619619
sub f { 1,2,3 };
620620
my ($a) = f;
621-
say $a.perl;
621+
say $a.raku;
622622
# OUTPUT: «1␤»
623623
624624
To skip elements in the list use the anonymous state variable C<$>.
625625
626626
my ($,$a,$,%h) = ('a', 'b', [1,2,3], {:1th});
627-
say [$a, %h].perl;
627+
say [$a, %h].raku;
628628
# OUTPUT: «["b", {:th(1)}]␤»
629629
630630
=head2 The C<has> declarator
@@ -775,14 +775,14 @@ Furthermore, state variables can be used outside of subroutines. You
775775
could, for example, use C<$> in a one-liner to number the lines in a file.
776776
777777
=begin code :lang<shell>
778-
perl6 -ne 'say ++$ ~ " $_"' example.txt
778+
raku -ne 'say ++$ ~ " $_"' example.txt
779779
=end code
780780
781781
Each reference to C<$> within a lexical scope is in effect a separate
782782
variable.
783783
784784
=begin code :lang<shell>
785-
perl6 -e '{ say ++$; say $++ } for ^5'
785+
raku -e '{ say ++$; say $++ } for ^5'
786786
# OUTPUT: «1␤0␤2␤1␤3␤2␤4␤3␤5␤4␤»
787787
=end code
788788
@@ -1488,7 +1488,7 @@ This shows additional information on the operating system and version it's
14881488
using, but as a matter of fact, this variable contains information which is
14891489
useful to create portable programs, such as the path separator:
14901490
1491-
say $*DISTRO.perl;
1491+
say $*DISTRO.raku;
14921492
# OUTPUT: «Distro.new(release => "42.3", is-win => Bool::False,
14931493
# path-sep => ":", name => "opensuse",
14941494
# auth => "https://www.opensuse.org/", version => v42.3,
@@ -1548,7 +1548,7 @@ X<|$*PROGRAM-NAME>
15481548
=head4 C<$*PROGRAM-NAME>
15491549
15501550
This contains the path to the current executable as it was entered on the
1551-
command line, or C<-e> if perl was invoked with the -e flag.
1551+
command line, or C<-e> if raku was invoked with the -e flag.
15521552
15531553
X<|$*PROGRAM>
15541554
=head4 C<$*PROGRAM>
@@ -1566,15 +1566,15 @@ Raku is embedded in another language runtime (such as Inline::Perl6 in Perl 5).
15661566
X<|$*EXECUTABLE>
15671567
=head4 C<$*EXECUTABLE>
15681568
1569-
Contains an C<IO::Path> absolute path of the perl executable that is currently
1569+
Contains an C<IO::Path> absolute path of the raku executable that is currently
15701570
running.
15711571
15721572
X<|$*EXECUTABLE-NAME>
15731573
=head4 C<$*EXECUTABLE-NAME>
15741574
1575-
Contains the name of the Perl executable that is currently running. (e.g.
1576-
perl6-p, perl6-m). Favor C<$*EXECUTABLE> over this one, since it's not
1577-
guaranteed that the perl executable is in C<PATH>.
1575+
Contains the name of the Raku executable that is currently running. (e.g.
1576+
raku-p, raku-m). Favor C<$*EXECUTABLE> over this one, since it's not
1577+
guaranteed that the raku executable is in C<PATH>.
15781578
15791579
X<|$*USAGE>
15801580
=head4 C<$*USAGE>
@@ -1648,7 +1648,7 @@ By default this imposes a maximum of 64 threads on the methods C<.hyper>,
16481648
C<.race> and other thread-pool classes that use that scheduler such as
16491649
C<Promise>s or C<Supply>s. This is, however, implementation, dependent and might
16501650
be subject to change. To change the maximum number of threads, you can either
1651-
set the environment variable C<RAKUDO_MAX_THREADS> before running perl6 or
1651+
set the environment variable C<RAKUDO_MAX_THREADS> before running raku or
16521652
create a scoped copy with the default changed before using them:
16531653
16541654
my $*SCHEDULER = ThreadPoolScheduler.new( max_threads => 128 );
@@ -1669,7 +1669,7 @@ message.
16691669
16701670
=for code
16711671
sub MAIN($a, :$b, UInt :$ehehe) {
1672-
say $*USAGE; # OUTPUT: «Usage:␤ perl6.pl6 [-a=<Int>] [-b=<Str>] [--<opts>=...]»
1672+
say $*USAGE; # OUTPUT: «Usage:␤ my-script.raku [-a=<Int>] [-b=<Str>] [--<opts>=...]»
16731673
}
16741674
16751675
It is accessible only inside of MAIN sub.

0 commit comments

Comments
 (0)