@@ -37,8 +37,8 @@ instance. Then,
37
37
zef install WWW
38
38
39
39
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 > .
42
42
43
43
44
44
= head2 Basic structure
@@ -52,9 +52,12 @@ L<synopsis S11|https://design.raku.org/S11.html#Units> says: Confusing? Yes it
52
52
is. > , a C < t > directory for tests, and possibly a C < bin > directory for
53
53
executable programs and scripts.
54
54
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. Β» .
58
61
59
62
X < |compunit >
60
63
= head1 Loading and basic importing
@@ -74,7 +77,7 @@ need MyModule;
74
77
Any packages in the namespace defined within will also be available.
75
78
76
79
= begin code :solo
77
- # MyModule.pm6
80
+ # MyModule.rakumod
78
81
unit module MyModule;
79
82
80
83
class Class {}
@@ -86,7 +89,7 @@ defined that way are not automatically exported; you will need to explicitly
86
89
export it if you want to use it by its short name:
87
90
88
91
= begin code :solo
89
- # MyModule.pm6
92
+ # MyModule.rakumod
90
93
unit module MyModule;
91
94
92
95
class Class is export {}
@@ -98,14 +101,13 @@ And then
98
101
use MyModule;
99
102
100
103
my $class = Class.new();
101
- say $class.perl ;
104
+ say $class.raku ;
102
105
= end code
103
106
104
107
= head2 X < C < use > >
105
108
106
109
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 >
109
111
for where the runtime will look for modules.
110
112
111
113
= for code :skip-test<needs dummy module>
@@ -259,7 +261,7 @@ so that the importer can pick and choose. There are three predefined
259
261
tags: C < ALL > , C < DEFAULT > and C < MANDATORY > .
260
262
261
263
= begin code :solo
262
- # lib/MyModule.pm6
264
+ # lib/MyModule.rakumod
263
265
unit module MyModule;
264
266
sub bag is export { ... }
265
267
# objects with tag ':MANDATORY' are always exported
@@ -270,7 +272,7 @@ tags: C<ALL>, C<DEFAULT> and C<MANDATORY>.
270
272
= end code
271
273
272
274
= begin code :skip-test<needs dummy module>
273
- # main.p6
275
+ # main.raku
274
276
use lib 'lib';
275
277
use MyModule; # bag, pants
276
278
use MyModule :DEFAULT; # the same
@@ -310,7 +312,7 @@ no matter whether the using program adds any tag or not.
310
312
4. Multiple import tags may be used (separated by commas). For example:
311
313
312
314
= begin code :skip-test<needs dummy module>
313
- # main.p6
315
+ # main.raku
314
316
use lib 'lib';
315
317
use MyModule :day, :night; # pants, sunglasses, torch
316
318
= end code
@@ -356,7 +358,7 @@ packages are useful when you want to produce the exported symbols
356
358
dynamically. For example:
357
359
358
360
= begin code :solo
359
- # lib/MyModule.pm6
361
+ # lib/MyModule.rakumod
360
362
unit module MyModule;
361
363
362
364
my package EXPORT::DEFAULT {
@@ -370,7 +372,7 @@ dynamically. For example:
370
372
= end code
371
373
372
374
= begin code :skip-test<needs dummy module>
373
- # main.p6
375
+ # main.raku
374
376
use MyModule;
375
377
say sqrt-of-four; # OUTPUT: Β«2β€Β»
376
378
say log-of-zero; # OUTPUT: Β«-Infβ€Β»
@@ -385,7 +387,7 @@ the values are the desired values. The names should include the sigil
385
387
(if any) for the associated type.
386
388
387
389
= begin code
388
- # lib/MyModule.pm6
390
+ # lib/MyModule.rakumod
389
391
390
392
class MyModule::Class { }
391
393
@@ -401,7 +403,7 @@ the values are the desired values. The names should include the sigil
401
403
= end code
402
404
403
405
= begin code :skip-test<needs dummy module>
404
- # main.p6
406
+ # main.raku
405
407
use lib 'lib';
406
408
use MyModule;
407
409
say $var; # OUTPUT: Β«oneβ€Β»
@@ -439,7 +441,7 @@ passing C<:DEFAULT> to C<use> along with your positional parameters.
439
441
= end code
440
442
441
443
= begin code :skip-test<needs dummy module>
442
- # main.p6
444
+ # main.raku
443
445
use lib 'lib';
444
446
use MyModule 'foo';
445
447
say foo.new(); # OUTPUT: Β«MyModule::Class.newβ€Β»
@@ -453,7 +455,7 @@ effect. This example creates a C<?> postfix which will only work on
453
455
L < Cool|/type/Cool > s.
454
456
455
457
= begin code
456
- # lib/MakeQuestionable.pm6
458
+ # lib/MakeQuestionable.rakumod
457
459
sub EXPORT(::Questionable) {
458
460
my multi postfix:<?>(Questionable $_) { .so };
459
461
%(
@@ -509,11 +511,11 @@ zef --force install .
509
511
X < |use lib >
510
512
A user may have a collection of modules not found in the normal ecosystem,
511
513
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:
514
516
515
517
= 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
517
519
518
520
Note that the comma (',') is used as the directory separator.
519
521
@@ -558,7 +560,7 @@ Make your project directory look like this:
558
560
Vortex-TotalPerspective/
559
561
βββ lib
560
562
β βββ Vortex
561
- β βββ TotalPerspective.pm6
563
+ β βββ TotalPerspective.rakumod
562
564
βββ LICENSE
563
565
βββ META6.json
564
566
βββ README.md
@@ -572,10 +574,10 @@ its job, they should go in your lib directory like so:
572
574
= begin code :lang<text>
573
575
lib
574
576
βββ Vortex
575
- βββ TotalPerspective.pm6
577
+ βββ TotalPerspective.rakumod
576
578
βββ TotalPerspective
577
- βββ FairyCake.pm6
578
- βββ Gargravarr.pm6
579
+ βββ FairyCake.rakumod
580
+ βββ Gargravarr.rakumod
579
581
= end code
580
582
= end item
581
583
@@ -598,7 +600,7 @@ C<META6.json>) so that the distribution path can be provided to the program.
598
600
{
599
601
"name" : "Vortex::TotalPerspective",
600
602
"provides" : {
601
- "Vortex::TotalPerspective" : "lib/Vortex/TotalPerspective.pm6 "
603
+ "Vortex::TotalPerspective" : "lib/Vortex/TotalPerspective.rakumod "
602
604
},
603
605
"resources": [ "templates/default-template.mustache"]
604
606
}
@@ -684,7 +686,7 @@ Make your X<C<META6.json>|META6.json> file look something like this:
684
686
"authors" : [ "R < Your Name > " ],
685
687
"license" : "Artistic-2.0",
686
688
"provides" : {
687
- "Vortex::TotalPerspective" : "lib/Vortex/TotalPerspective.pm6 "
689
+ "Vortex::TotalPerspective" : "lib/Vortex/TotalPerspective.rakumod "
688
690
},
689
691
"depends" : [ ],
690
692
"build-depends" : [ ],
0 commit comments