@@ -24,69 +24,69 @@ been in Apocalypse 11.
24
24
25
25
=head1 Units
26
26
27
- Perl 6 code is compiled per compilation unit, or " compunit" for short. These
27
+ Perl 6 code is compiled per compilation unit, or I< compunit> for short. These
28
28
are either stored in a file (usually with a .pm or .pm6 extension) and loaded
29
29
with a C<use>, C<need> or C<require> statement. Or they are created as a
30
30
string in a variable and compiled with an C<eval> statement. This synopsis is
31
31
mostly about compunits stored in a file.
32
32
33
- In the common vernacular of a Perl 5 developer, a " module" is the same as the
33
+ In the common vernacular of a Perl 5 developer, a I< module> is the same as the
34
34
file that contains the source code of a package. For Perl 6 developers, this
35
- is not much different. However, such a " module" is really a compunit that may
36
- contain 0 or more package-like statements of " modules" . Confusing? Yes it is.
37
- On top of that, Perl 6 allows different versions of the same " module" to be
35
+ is not much different. However, such a I< module> is really a compunit that may
36
+ contain 0 or more package-like statements of I< modules> . Confusing? Yes it is.
37
+ On top of that, Perl 6 allows different versions of the same I< module> to be
38
38
installed in a single directory. And it allows compunits from other languages
39
39
to be loaded.
40
40
41
41
In Perl, the C<use> statement is really just telling Perl to find a file for
42
42
the given name (after some name to filename translation logic has been applied)
43
43
and load its contents. Whether that name is the name of a C<package>,
44
- C<module>, C<class>, C<grammer > or C<role>, a combination of these or
44
+ C<module>, C<class>, C<grammar > or C<role>, a combination of these or
45
45
something else entirely in a C<slang>, is B<not> known at the moment the file
46
46
is searched (and found). Only when the contents of a file are compiled, does
47
47
Perl find out what's inside.
48
48
49
- In Perl 5, the name to filename translation is mechanical. Foo::Bar will
50
- always refer to Foo/Bar.pm in a directory: it does not need any outside
49
+ In Perl 5, the name to filename translation is mechanical. C< Foo::Bar> will
50
+ always refer to C< Foo/Bar.pm> in a directory: it does not need any outside
51
51
information to find out the name of the file to be loaded. For files that
52
52
reside in directories that are not part of the installation, this is the same
53
53
in Perl 6. These directories are however typically used for development and/or
54
54
testing. Such a directory can be marked as not allowing installed compunits,
55
- e.g. by the existence of a hidden file like " .camelia_dev" .
55
+ e.g. by the existence of a hidden file like C< .camelia_dev> .
56
56
57
57
In Perl 6, this is not an option for compunits that have been installed: the
58
58
name that indicates a compunit, is case-sensitive and in Unicode. This needs
59
59
to be supported even on a system that has a filesystem that is case-insensitive
60
60
and/or does not support Unicode and/or does not allow long enough filenames.
61
61
Let alone be able to store meta-information, such as the version of the
62
- compunit. Therefor , an authoritative " database" of meta-information of
62
+ compunit. Therefore , an authoritative I< database> of meta-information of
63
63
installed compunits is needed in those directories that contain installed
64
64
compunits. Such a database could be as simple as a hidden text-file named
65
- " .camelia" .
65
+ C< .camelia> .
66
66
67
- The optional " unit" statement provides all the necessary meta-information that
67
+ The optional C< unit> statement provides all the necessary meta-information that
68
68
is needed to add a compunit to a given Perl 6 installation, as well as being
69
69
able to load the compunit at a later time. There can only be at most one
70
- " unit" statement per compunit, and it must occur B<before> any " module" -like
70
+ C< unit> statement per compunit, and it must occur B<before> any C< module> -like
71
71
statement.
72
72
73
73
The syntax of such a unit declaration has multiple parts in which the
74
74
non-identifier parts are specified in adverbial pair notation without
75
75
intervening spaces. You may write the various parts in any order, except
76
76
that the compunit identifier must come first. The required parts for library
77
77
insertion are the name of the compunit, a URI identifying the author
78
- (or authorizing authority, so we call it " auth" to be intentionally ambiguous),
79
- and its version number (" ver" for short). For example:
78
+ (or authorizing authority, so we call it I< auth> to be intentionally ambiguous),
79
+ and its version number (I< ver> for short). For example:
80
80
81
81
unit Dog:auth<cpan:JRANDOM>:ver<1.2.1>;
82
82
unit Dog:auth<http://www.some.com/~jrandom>:ver<1.2.1>;
83
83
unit Dog:auth<mailto:jrandom@some.com>:ver<1.2.1>;
84
84
85
- The combination of name, " auth" and " ver" , we call the " credentials" of a
85
+ The combination of name, I< auth> and I< ver> , we call the I< credentials> of a
86
86
compunit.
87
87
88
88
If a compunit is missing a unit declaration, then the name of the first
89
- " module" -like statement will be assumed as the name of the unit, and the
89
+ C< module> -like statement will be assumed as the name of the unit, and the
90
90
credentials will be assumed to be just the name. So:
91
91
92
92
class Dog;
@@ -105,10 +105,10 @@ indentical credentials before.
105
105
106
106
=head1 Modules
107
107
108
- As in Perl 5, a " module" is just a kind of package. Unlike in
108
+ As in Perl 5, a C< module> is just a kind of package. Unlike in
109
109
Perl 5, modules and classes are declared with separate keywords,
110
110
but they're still just packages with extra behaviors. In the case
111
- of modules, the extra behavior is the availability of the ' export' trait
111
+ of modules, the extra behavior is the availability of the C< export> trait
112
112
and any associated support for Perl 6 standard export semantics.
113
113
114
114
A module is declared with the C<module> keyword. There are
@@ -142,7 +142,7 @@ does not imply globalness (unlike in Perl 5).
142
142
The default namespace for the main program is C<GLOBAL>.
143
143
(Putting C<module GLOBAL;> at the top of your program
144
144
is redundant, except insofar as it tells Perl that the code is Perl
145
- 6 code and not Perl 5 code. But it's better to say " use v6" for that.)
145
+ 6 code and not Perl 5 code. But it's better to say C< use v6> for that.)
146
146
147
147
Module traits are set using C<is>:
148
148
@@ -557,7 +557,7 @@ Once the auth is selected, then and only then is any version
557
557
selection done. This implies that all official compunits record
558
558
permanently when they were first installed in the official library,
559
559
and this creation date is considered immutable. This date must be specified
560
- with the " :created" adverb in the " unit" statement.
560
+ with the C< :created> adverb in the C< unit> statement.
561
561
562
562
unit Test:auth<cpan:TPF>:ver<1.0>:created<20130625>;
563
563
@@ -677,7 +677,7 @@ version number or other literal:
677
677
6;
678
678
"Coolness, dude!";
679
679
680
- it runs Perl 6 in " lax" mode, without strictures or warnings, since obviously
680
+ it runs Perl 6 in I< lax> mode, without strictures or warnings, since obviously
681
681
a bare literal in a sink (void) context I<ought> to have produced a "Useless use of..." warning.
682
682
(Invoking perl with C<-e '6;'> has the same effect.)
683
683
@@ -699,7 +699,7 @@ deeply to switch between Perl versions:
699
699
It's not necessary to force Perl 6 if the interpreter or command
700
700
specified already implies it, such as use of a "C<#!/usr/bin/perl6>"
701
701
shebang line. Nor is it necessary to force Perl 6 in any file that
702
- begins with the " unit", " class", " module", " grammar" or " role" keywords.
702
+ begins with the C< unit>, C< class>, C< module>, C< grammar> or C< role> keywords.
703
703
704
704
=head1 Tool use vs language changes
705
705
@@ -723,7 +723,7 @@ a derivative of the standard Perl grammar).
723
723
724
724
Language tweaks are considered part of the interface of any namespace
725
725
you import. Version numbers are assumed to represent a combination of
726
- interface and patch level. We will use the term " interface version"
726
+ interface and patch level. We will use the term I< interface version>
727
727
to represent that part of the version number that represents the
728
728
interface. For typical version number schemes, this is the first two
729
729
numbers (where the third number usually represents patch level within
0 commit comments