Skip to content

Commit a1de178

Browse files
authored
Merge pull request #3298 from uzluisf/master
Perl 6 extensions -> Raku extensions
2 parents a3f66fb + a20128a commit a1de178

File tree

1 file changed

+30
-28
lines changed

1 file changed

+30
-28
lines changed

β€Ždoc/Language/modules.pod6

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ instance. Then,
3737
zef install WWW
3838
3939
will install the module with that particular name, if it is not already
40-
installed. N<If it's installed, it will reinstall only if the version of
41-
the module is newer than the one installed>
40+
installed N<If it's installed, it will reinstall only if the version of
41+
the module is newer than the one installed>.
4242
4343
4444
=head2 Basic structure
@@ -52,9 +52,12 @@ L<synopsis S11|https://design.raku.org/S11.html#Units> says: Confusing? Yes it
5252
is.> , a C<t> directory for tests, and possibly a C<bin> directory for
5353
executable programs and scripts.
5454
55-
Source files generally use the C<.pm6> extension, and scripts or
56-
executables use the C<.p6>. Test files use the C<.t> extension. Files which
57-
contain documentation use the C<.pod6> extension.
55+
Source files generally use the C<.rakumod> extension, and scripts or
56+
executables use the C<.raku>. Test files use the C<.rakutest> (or C<.t>)
57+
extension. Files which contain documentation use the C<.rakudoc> extension NΒ«The
58+
old C<.p6> (or C<.pl6>), C<.pm6> (or C<.pm> which is also supported, but
59+
discouraged) and C<.pod6> extensions will continue to be supported for 6.e
60+
and marked as B<deprecated> in 6.f.Β».
5861
5962
X<|compunit>
6063
=head1 Loading and basic importing
@@ -74,7 +77,7 @@ need MyModule;
7477
Any packages in the namespace defined within will also be available.
7578
7679
=begin code :solo
77-
# MyModule.pm6
80+
# MyModule.rakumod
7881
unit module MyModule;
7982
8083
class Class {}
@@ -86,7 +89,7 @@ defined that way are not automatically exported; you will need to explicitly
8689
export it if you want to use it by its short name:
8790
8891
=begin code :solo
89-
# MyModule.pm6
92+
# MyModule.rakumod
9093
unit module MyModule;
9194
9295
class Class is export {}
@@ -98,14 +101,13 @@ And then
98101
use MyModule;
99102
100103
my $class = Class.new();
101-
say $class.perl;
104+
say $class.raku;
102105
=end code
103106
104107
=head2 X<C<use>>
105108
106109
C<use> loads and then imports from a compunit at compile time. It will look for
107-
files that end in C<.pm6> (C<.pm> is also supported, but discouraged). See
108-
L<here|/language/modules#Finding_installed_modules>
110+
files that end in C<.rakumod>. See L<here|/language/modules#Finding_installed_modules>
109111
for where the runtime will look for modules.
110112
111113
=for code :skip-test<needs dummy module>
@@ -259,7 +261,7 @@ so that the importer can pick and choose. There are three predefined
259261
tags: C<ALL>, C<DEFAULT> and C<MANDATORY>.
260262
261263
=begin code :solo
262-
# lib/MyModule.pm6
264+
# lib/MyModule.rakumod
263265
unit module MyModule;
264266
sub bag is export { ... }
265267
# objects with tag ':MANDATORY' are always exported
@@ -270,7 +272,7 @@ tags: C<ALL>, C<DEFAULT> and C<MANDATORY>.
270272
=end code
271273
272274
=begin code :skip-test<needs dummy module>
273-
# main.p6
275+
# main.raku
274276
use lib 'lib';
275277
use MyModule; # bag, pants
276278
use MyModule :DEFAULT; # the same
@@ -310,7 +312,7 @@ no matter whether the using program adds any tag or not.
310312
4. Multiple import tags may be used (separated by commas). For example:
311313
312314
=begin code :skip-test<needs dummy module>
313-
# main.p6
315+
# main.raku
314316
use lib 'lib';
315317
use MyModule :day, :night; # pants, sunglasses, torch
316318
=end code
@@ -356,7 +358,7 @@ packages are useful when you want to produce the exported symbols
356358
dynamically. For example:
357359
358360
=begin code :solo
359-
# lib/MyModule.pm6
361+
# lib/MyModule.rakumod
360362
unit module MyModule;
361363
362364
my package EXPORT::DEFAULT {
@@ -370,7 +372,7 @@ dynamically. For example:
370372
=end code
371373
372374
=begin code :skip-test<needs dummy module>
373-
# main.p6
375+
# main.raku
374376
use MyModule;
375377
say sqrt-of-four; # OUTPUT: «2␀»
376378
say log-of-zero; # OUTPUT: «-Inf␀»
@@ -385,7 +387,7 @@ the values are the desired values. The names should include the sigil
385387
(if any) for the associated type.
386388
387389
=begin code
388-
# lib/MyModule.pm6
390+
# lib/MyModule.rakumod
389391
390392
class MyModule::Class { }
391393
@@ -401,7 +403,7 @@ the values are the desired values. The names should include the sigil
401403
=end code
402404
403405
=begin code :skip-test<needs dummy module>
404-
# main.p6
406+
# main.raku
405407
use lib 'lib';
406408
use MyModule;
407409
say $var; # OUTPUT: «one␀»
@@ -439,7 +441,7 @@ passing C<:DEFAULT> to C<use> along with your positional parameters.
439441
=end code
440442
441443
=begin code :skip-test<needs dummy module>
442-
# main.p6
444+
# main.raku
443445
use lib 'lib';
444446
use MyModule 'foo';
445447
say foo.new(); # OUTPUT: «MyModule::Class.new␀»
@@ -453,7 +455,7 @@ effect. This example creates a C<?> postfix which will only work on
453455
L<Cool|/type/Cool>s.
454456
455457
=begin code
456-
# lib/MakeQuestionable.pm6
458+
# lib/MakeQuestionable.rakumod
457459
sub EXPORT(::Questionable) {
458460
my multi postfix:<?>(Questionable $_) { .so };
459461
%(
@@ -509,11 +511,11 @@ zef --force install .
509511
X<|use lib>
510512
A user may have a collection of modules not found in the normal ecosystem,
511513
maintained by a module or package manager, but needed regularly. Instead of
512-
using the C<use lib> pragma one can use the C<PERL6LIB> environment variable to
513-
point to module locations. For example:
514+
using the C<use lib> pragma one can use the C<RAKULIB> environment variable to
515+
point to module locations. For example:
514516
515517
=for code :lang<shell>
516-
export PERL6LIB=/path/to/my-modules,/path/to/more/modules
518+
export RAKULIB=/path/to/my-modules,/path/to/more/modules
517519
518520
Note that the comma (',') is used as the directory separator.
519521
@@ -558,7 +560,7 @@ Make your project directory look like this:
558560
Vortex-TotalPerspective/
559561
β”œβ”€β”€ lib
560562
β”‚ └── Vortex
561-
β”‚ └── TotalPerspective.pm6
563+
β”‚ └── TotalPerspective.rakumod
562564
β”œβ”€β”€ LICENSE
563565
β”œβ”€β”€ META6.json
564566
β”œβ”€β”€ README.md
@@ -572,10 +574,10 @@ its job, they should go in your lib directory like so:
572574
=begin code :lang<text>
573575
lib
574576
└── Vortex
575-
β”œβ”€β”€ TotalPerspective.pm6
577+
β”œβ”€β”€ TotalPerspective.rakumod
576578
└── TotalPerspective
577-
β”œβ”€β”€ FairyCake.pm6
578-
└── Gargravarr.pm6
579+
β”œβ”€β”€ FairyCake.rakumod
580+
└── Gargravarr.rakumod
579581
=end code
580582
=end item
581583
@@ -598,7 +600,7 @@ C<META6.json>) so that the distribution path can be provided to the program.
598600
{
599601
"name" : "Vortex::TotalPerspective",
600602
"provides" : {
601-
"Vortex::TotalPerspective" : "lib/Vortex/TotalPerspective.pm6"
603+
"Vortex::TotalPerspective" : "lib/Vortex/TotalPerspective.rakumod"
602604
},
603605
"resources": [ "templates/default-template.mustache"]
604606
}
@@ -684,7 +686,7 @@ Make your X<C<META6.json>|META6.json> file look something like this:
684686
"authors" : [ "R<Your Name>" ],
685687
"license" : "Artistic-2.0",
686688
"provides" : {
687-
"Vortex::TotalPerspective" : "lib/Vortex/TotalPerspective.pm6"
689+
"Vortex::TotalPerspective" : "lib/Vortex/TotalPerspective.rakumod"
688690
},
689691
"depends" : [ ],
690692
"build-depends" : [ ],

0 commit comments

Comments
Β (0)