Skip to content

Commit 7b9d54f

Browse files
authored
Merge pull request #1 from perl6/master
update from base
2 parents df3cd63 + 92ff8fd commit 7b9d54f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1832
-1092
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ This is currently the recommended way to consume the documentation.
88
There is also a command line tool called `p6doc`, which you can use to
99
browse the documentation once it's installed (see below).
1010

11+
This documentation is updated frequently to a GitHub mirror
12+
https://perl6docs.github.io but that might be out of sync with the
13+
official one.
14+
1115
## Docker container
1216

1317
This documentation is also published as

doc/HomePage.pod6

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ by reporting mistakes or sending patches.
3434
3535
<dt><a href="/programs.html">Perl 6 Programs</a></dt>
3636
<dd>
37-
A collection of documents describing how to
38-
run the Perl 6 executable program and other utilities,
37+
A collection of documents describing the variables that affect the the Perl 6 executable, how to run the p6doc documentation front-end,
3938
how to debug Perl 6 programs, and how to hack on Perl 6
4039
source code.
4140
</dd>

doc/Language/5to6-nutshell.pod6

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ an embedded instance of the C<perl> interpreter to run Perl 5 code.
4242
4343
This is as simple as:
4444
45-
=for code :skip-test<Inline module not always present when testing>
45+
=for code :skip-test<needs ecosystem>
4646
# the :from<Perl5> makes Perl 6 load Inline::Perl5 first (if installed)
4747
# and then load the Scalar::Util module from Perl 5
4848
use Scalar::Util:from<Perl5> <looks_like_number>;
@@ -578,7 +578,7 @@ arguments. For example, C<31 | 33> returns a different result than C<"31" |
578578
In Perl 6, those single-character ops have been removed, and replaced by
579579
two-character ops which coerce their arguments to the needed context.
580580
581-
=begin code :skip-test
581+
=begin code :lang<text>
582582
# Infix ops (two arguments; one on each side of the op)
583583
+& +| +^ And Or Xor: Numeric
584584
~& ~| ~^ And Or Xor: String
@@ -1581,7 +1581,7 @@ sub baz($z) { say "baz $z" }
15811581
To use this module, simply C<use Bar> and the functions C<foo> and
15821582
C<bar> will be available
15831583
1584-
=for code :skip-test
1584+
=for code :skip-test<needs dummy module>
15851585
use Bar;
15861586
foo(1); #=> "foo 1"
15871587
bar(2); #=> "bar 2"
@@ -1628,30 +1628,30 @@ module.
16281628
So, to import only the C<foo> routine, we do the following in the
16291629
calling code:
16301630
1631-
=for code :skip-test
1631+
=for code :skip-test<needs dummy module>
16321632
use Bar <foo>;
16331633
foo(1); #=> "foo 1"
16341634
16351635
Here we see that even though C<bar> is exportable, if we don't
16361636
explicitly import it, it's not available for use. Hence this causes an
16371637
"Undeclared routine" error at compile time:
16381638
1639-
=for code :skip-test
1639+
=for code :skip-test<needs dummy module>
16401640
use Bar <foo>;
16411641
foo(1);
16421642
bar(5); #!> "Undeclared routine: bar used at line 3"
16431643
16441644
However, this will work
16451645
1646-
=for code :skip-test
1646+
=for code :skip-test<needs dummy module>
16471647
use Bar <foo bar>;
16481648
foo(1); #=> "foo 1"
16491649
bar(5); #=> "bar 5"
16501650
16511651
Note also that C<baz> remains unimportable even if specified in the
16521652
C<use> statement:
16531653
1654-
=for code :skip-test
1654+
=for code :skip-test<needs dummy module>
16551655
use Bar <foo bar baz>;
16561656
baz(3); #!> "Undeclared routine: baz used at line 2"
16571657
@@ -1678,7 +1678,7 @@ sub baz() is export(:DEFAULT:FNORBL) { } # added to both
16781678
16791679
So now you can use the C<Bar> module like this:
16801680
1681-
=for code :skip-test
1681+
=for code :skip-test<needs dummy module>
16821682
use Bar; # imports foo / baz
16831683
use Bar :FNORBL; # imports bar / baz
16841684
use Bar :ALL; # imports foo / bar / baz

doc/Language/5to6-perlvar.pod6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ No longer exists in Perl 6. Because each Repository is responsible for
173173
remembering which modules have been loaded already. You can get a list
174174
of all loaded modules (compilation units) like so:
175175
176-
=for code :skip-test<missing module>
176+
=for code :skip-test<needs dummy module>
177177
use Test;
178178
use MyModule;
179179
say flat $*REPO.repo-chain.map(*.loaded); #-> (MyModule Test)

doc/Language/about.pod6

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ All of the paragraphs and blocks following that directive, up until the
7171
next directive of the same level, will be considered part of the
7272
documentable. So, in:
7373
74-
=begin code :allow<R> :skip-test
74+
=begin code :allow<R> :lang<pod6>
7575
=head2 R<My Definition>
7676
7777
Some paragraphs, followed by some code:
@@ -148,4 +148,4 @@ Notice that text after a pipe ('|') has no formatting. Also note that B<V< C<> >
148148
preserves spaces and treats text as verbatim.
149149
=end pod
150150

151-
# vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6
151+
# vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6

doc/Language/classtut.pod6

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ this attribute is private to the class.
223223
224224
The second declaration also uses the private twigil:
225225
226-
=for code :skip-test
227-
has Task @!dependencies;
226+
=for code :preamble<class Task {}>
227+
has Task @!dependencies;
228228
229229
However, this attribute represents an array of items, so it requires the
230230
C<@> sigil. These items each specify a task that must be completed before
@@ -276,9 +276,9 @@ those with and without accessors):
276276
The assignment is carried out at object build time. The right-hand side is
277277
evaluated at that time, and can even reference earlier attributes:
278278
279-
=for code :skip-test
280-
has Task @!dependencies;
281-
has $.ready = not @!dependencies;
279+
=for code :preamble<class Task {}>
280+
has Task @!dependencies;
281+
has $.ready = not @!dependencies;
282282
283283
Writable attributes are accessible through writable containers:
284284
@@ -367,7 +367,7 @@ ignore the C<new> method temporarily; it's a special type of method.
367367
Consider the second method, C<add-dependency>, which adds a new task to a
368368
task's dependency list.
369369
370-
=begin code :skip-test
370+
=begin code :skip-test<incomplete code>
371371
method add-dependency(Task $dependency) {
372372
push @!dependencies, $dependency;
373373
}
@@ -386,7 +386,7 @@ attribute.
386386
387387
The C<perform> method contains the main logic of the dependency handler:
388388
389-
=begin code :skip-test
389+
=begin code :skip-test<incomplete code>
390390
method perform() {
391391
unless $!done {
392392
.perform() for @!dependencies;
@@ -490,8 +490,9 @@ allowed to bind things to C<&!callback> and C<@!dependencies> directly. To
490490
do this, we override the C<BUILD> submethod, which is called on the brand
491491
new object by C<bless>:
492492
493-
=for code :skip-test
494-
submethod BUILD(:&!callback, :@!dependencies) { }
493+
=begin code :preamble<has &.callback; has @.dependencies;>
494+
submethod BUILD(:&!callback, :@!dependencies) { }
495+
=end code
495496
496497
Since C<BUILD> runs in the context of the newly created C<Task> object, it
497498
is allowed to manipulate those private attributes. The trick here is that
@@ -503,15 +504,15 @@ more information.
503504
The C<BUILD> method is responsible for initializing all attributes and must also
504505
handle default values:
505506
506-
=begin code :skip-test
507+
=begin code
507508
has &!callback;
508509
has @!dependencies;
509510
has Bool ($.done, $.ready);
510511
submethod BUILD(
511512
:&!callback,
512513
:@!dependencies,
513514
:$!done = False,
514-
:$!ready = not @!dependencies
515+
:$!ready = not @!dependencies,
515516
) { }
516517
=end code
517518

doc/Language/concurrency.pod6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ execution before normal completion:
758758
$cancellation.cancel;
759759
sleep 10;
760760
761-
should only output 0 to 5,
761+
should only output 0 to 5.
762762
763763
Despite the apparent advantage the L<Scheduler|/type/Scheduler> interface provides over
764764
that of L<Thread|/type/Thread> all of functionality is available through higher level

doc/Language/control.pod6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Class bodies behave like simple blocks for any top level expression; same goes
8989
to roles and other packages, like grammars (which are actually classes)
9090
or modules.
9191
92-
=begin code :skip-test<Fails>
92+
=begin code :skip-test<dies deliberately>
9393
class C {
9494
say "I live";
9595
die "I will never live!"

doc/Language/experimental.pod6

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Macro processing happens during parsing time. A macro generates an abstract
6161
syntax tree, which is grafted into the program syntax tree. C<quasi> is the
6262
routine that performs this task.
6363
64-
=begin code :skip-test<need use experimental>
64+
=begin code :skip-test<needs experimental>
6565
macro does-nothing() {
6666
quasi {}
6767
};
@@ -72,7 +72,7 @@ X<|quasi (macros)>
7272
Macros are a kind of routine, so they can take arguments in exactly the same
7373
way, and act also in almost the same way.
7474
75-
=begin code :skip-test<need use experimental>
75+
=begin code :skip-test<needs experimental>
7676
macro is-mighty( $who ) {
7777
quasi { "$who is mighty!"}
7878
};
@@ -86,7 +86,7 @@ including the quotes. Please note that we can also eliminate the parentheses for
8686
a macro call, following the same rules as a routine. You can use the unquoting
8787
construct C<{{{}}}> to get rid of this kind of thing:
8888
89-
=begin code :skip-test<need use experimental>
89+
=begin code :skip-test<needs experimental>
9090
macro is-mighty( $who ) {
9191
quasi { {{{$who}}} ~ " is mighty!"}
9292
};
@@ -96,7 +96,7 @@ say is-mighty "Freija"; # OUTPUT: «Freija is mighty!␤»
9696
Since macro expansion happens at parse time, care must be taken when using
9797
external variables in them:
9898
99-
=begin code :skip-test<need use experimental>
99+
=begin code :skip-test<needs experimental>
100100
use experimental :macros;
101101
my $called;
102102
macro called() {
@@ -136,7 +136,7 @@ It can be used when heavy calculations are involved, as in this sample that uses
136136
L<amicable numbers|https://perl6advent.wordpress.com/2018/12/25/calling-numbers-names/#more-7528>,
137137
taken from the 2018 Advent Calendar:
138138
139-
=begin code :skip-test<Uses experimental>
139+
=begin code :skip-test<needs experimental>
140140
use experimental :cached;
141141
142142
sub aliquot-parts( $number ) is cached {

doc/Language/functions.pod6

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ arguments. Consider this basic example:
362362
congratulate('being a cool number', 'Fred'); # OK
363363
congratulate('being a cool number', 'Fred', 42); # OK
364364
365-
=for code :skip-test<Proto match error>
365+
=for code :skip-test<illustrates error>
366366
congratulate('being a cool number', 42); # Proto match error
367367
368368
The proto insists that all C<multi congratulate> subs conform to the basic
@@ -395,7 +395,7 @@ with. Parameter defaults and type coercions will work but are not passed on.
395395
proto mistake-proto(Str() $str, Int $number = 42) {*}
396396
multi mistake-proto($str, $number) { say $str.^name }
397397
mistake-proto(7, 42); # OUTPUT: «Int␤» -- not passed on
398-
=for code :skip-test<compilation error>
398+
=for code :skip-test<illustrates error>
399399
mistake-proto('test'); # fails -- not passed on
400400
401401
=head2 X<only|declarator>
@@ -764,7 +764,7 @@ type, variable, routine, attribute, or other language object.
764764
765765
Examples of traits are:
766766
767-
=for code :skip-test
767+
=for code :skip-test<incomplete code>
768768
class ChildClass is ParentClass { ... }
769769
# ^^ trait, with argument ParentClass
770770
has $.attrib is rw;
@@ -1025,9 +1025,10 @@ say square-root(-4); # OUTPUT: «0+2i␤»
10251025
10261026
Another use case is to re-dispatch to methods from parent classes.
10271027
1028-
=begin code
1028+
=for code
10291029
say Version.new('1.0.2') # OUTPUT: v1.0.2
10301030
1031+
=begin code
10311032
class LoggedVersion is Version {
10321033
method new(|c) {
10331034
note "New version object created with arguments " ~ c.perl;

0 commit comments

Comments
 (0)