Skip to content

Commit 9ca6c44

Browse files
committed
Some corrections and reflow
1 parent 1043e93 commit 9ca6c44

File tree

2 files changed

+40
-27
lines changed

2 files changed

+40
-27
lines changed

doc/Language/modules.pod6

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,28 @@
66
77
=head1 Creating and using modules
88
9-
A module is usually a source file or set of source files
10-
N<Technically a module is a set of I<compunits> which are usually files but could come from anywhere as long as there is a I<compunit repository> that can provide it. See L<S11|https://design.perl6.org/S11.html>.>
11-
that
12-
expose Perl 6 constructs. These are typically packages
13-
(L<classes|/language/objects#Classes>,
9+
A module is usually a source file or set of source files that expose Perl 6
10+
constructs.
11+
12+
N<Technically a
13+
module is a set of I<compunits> which are usually files but could come from
14+
anywhere as long as there is a I<compunit repository> that can provide it. See
15+
L<S11|https://design.perl6.org/S11.html>.>
16+
17+
Modules are typically packages (L<classes|/language/objects#Classes>,
1418
L<roles|/language/objects#Roles>, L<grammars|Grammar>),
1519
L<subroutines|/language/functions>, and sometimes
16-
L<variables|/language/variables>. In Perl 6 I<module> can also refer
17-
to a type of package declared with the C<module> keyword (see
18-
L<Module Packages|/language/module-packages> and the examples
19-
below) but here we mostly mean "module" as a set of source
20-
files in a namespace.
20+
L<variables|/language/variables>. In Perl 6 I<module> can also refer to a type
21+
of package declared with the C<module> keyword (see L<Module
22+
Packages|/language/module-packages> and the examples below) but here we mostly
23+
mean "module" as a set of source files in a namespace.
2124
2225
=head2 Looking for and installing modules.
2326
24-
L<C<zef>|https://github.com/ugexe/zef> is the application using for installing modules in Perl 6. Modules are listed in L<the Perl 6 ecosystem|https://modules.perl6.org> and can be searched there or from the command line using C<zef search>
27+
L<C<zef>|https://github.com/ugexe/zef> is the application using for installing
28+
modules in Perl 6. Modules are listed in L<the Perl 6
29+
ecosystem|https://modules.perl6.org> and can be searched there or from the
30+
command line using C<zef search>
2531
2632
=for code :lang<shell>
2733
zef search WWW
@@ -258,7 +264,8 @@ tags: C<ALL>, C<DEFAULT> and C<MANDATORY>.
258264
# lib/MyModule.pm6
259265
unit module MyModule;
260266
sub bag is export { ... }
261-
sub pants is export(:MANDATORY) { ... } # objects with tag ':MANDATORY' are always exported
267+
# objects with tag ':MANDATORY' are always exported
268+
sub pants is export(:MANDATORY) { ... }
262269
sub sunglasses is export(:day) { ... }
263270
sub torch is export(:night) { ... }
264271
sub underpants is export(:ALL) { ... }
@@ -608,7 +615,12 @@ C<Test>.
608615
609616
=begin item
610617
611-
To document your modules, use L<Perl 6 Pod |https://design.perl6.org/S26.html> markup inside your modules. Module documentation is most appreciated and will be especially important once the Perl 6 module directory (or some other site) begins rendering Pod docs as HTML for easy browsing. If you have extra docs (in addition to the Pod docs in your module(s)), create a C<doc> directory for them. Follow the same folder structure as the C<lib> directory like so:
618+
To document your modules, use L<Perl 6 Pod |https://design.perl6.org/S26.html>
619+
markup inside your modules. Module documentation is most appreciated and will be
620+
especially important once the Perl 6 module directory (or some other site)
621+
begins rendering Pod docs as HTML for easy browsing. If you have extra docs (in
622+
addition to the Pod docs in your module(s)), create a C<doc> directory for
623+
them. Follow the same folder structure as the C<lib> directory like so:
612624
613625
=begin code :lang<text>
614626
doc

doc/Language/packages.pod6

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
77
=begin comment
88
9+
TODO
910
* Take a lot of stuff from S02 for this
1011
* Document 'import'
1112
@@ -32,13 +33,13 @@ class Foo {
3233
}
3334
}
3435
35-
my $foo; # simple identifiers
36-
say Foo::Bar.baz; # Calling a method; OUTPUT: «Þor is mighty␤»
36+
my $foo; # simple identifiers
37+
say Foo::Bar.baz; # Calling a method; OUTPUT: «Þor is mighty␤»
3738
say Foo::Bar::zape; # compound identifiers separated by ::; OUTPUT: «zipi␤»
3839
my $bar = 'Bar';
39-
say $Foo::($bar)::quux; # compound identifiers with interpolations; OUTPUT: «42␤»
40-
$42; # numeric names
41-
$!; # certain punctuation variables
40+
say $Foo::($bar)::quux;# compound identifiers with interpolations; OUTPUT: «42␤»
41+
$42; # numeric names
42+
$!; # certain punctuation variables
4243
=end code
4344
4445
X<|::,package>
@@ -73,13 +74,12 @@ X«|MY (package)»X«|OUR (package)»X«|CORE (package)»X«|GLOBAL (package)»X
7374
The following pseudo-package names are reserved at the front of a name:
7475
7576
=begin table
76-
MY Symbols in the current lexical scope (aka $?SCOPE)
77-
OUR Symbols in the current package (aka $?PACKAGE)
78-
CORE Outermost lexical scope, definition of standard Perl
79-
GLOBAL Interpreter-wide package symbols, really UNIT::GLOBAL
80-
PROCESS Process-related globals (superglobals). The last place dynamic variable
81-
lookup will look.
82-
COMPILING Lexical symbols in the scope being compiled
77+
MY Symbols in the current lexical scope (aka $?SCOPE)
78+
OUR Symbols in the current package (aka $?PACKAGE)
79+
CORE Outermost lexical scope, definition of standard Perl
80+
GLOBAL Interpreter-wide package symbols, really UNIT::GLOBAL
81+
PROCESS Process-related globals (superglobals). The last place dynamic variable lookup will look.
82+
COMPILING Lexical symbols in the scope being compiled
8383
=end table
8484
8585
X«|CALLER (package)»X«|CALLERS (package)»X«|DYNAMIC (package)»X«|OUTER (package)»X«|OUTERS (package)»X«|LEXICAL (package)»X«|UNIT (package)»X«|SETTING (package)»X«|PARENT (package)»X«|CLIENT (package)»
@@ -225,8 +225,9 @@ MyType::<$foo>
225225
226226
=head2 Class member lookup
227227
228-
Methods—including auto-generated methods, such as public attributes' accessors—are stored
229-
in the class meta object and can be looked up through by the L<lookup|/routine/lookup> method.
228+
Methods—including auto-generated methods, such as public attributes'
229+
accessors—are stored in the class meta object and can be looked up through by
230+
the L<lookup|/routine/lookup> method.
230231
231232
=for code :skip-test
232233
Str.^lookup('chars')

0 commit comments

Comments
 (0)