Skip to content

Commit d83acf3

Browse files
committed
Suppress word variats refs #3024
1 parent 2a1c596 commit d83acf3

File tree

1 file changed

+26
-27
lines changed

1 file changed

+26
-27
lines changed

doc/Language/mop.pod6

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
=begin pod :kind("Language") :subkind("Language") :category("fundamental")
22
3-
=TITLE Meta-object protocol (MOP)
3+
=TITLE Metaobject protocol (MOP)
44
55
=SUBTITLE Introspection and the Perl 6 object system
66
77
X<|MOP>
88
X<|Introspection>
99
10-
Perl 6 is built on a meta object layer. That means that there are objects
11-
(the I<meta objects>) that control how various object-oriented constructs
10+
Perl 6 is built on a metaobject layer. That means that there are objects
11+
(the I<metaobjects>) that control how various object-oriented constructs
1212
(such as classes, roles, methods, attributes or enums) behave.
1313
14-
The meta object has a practical benefit to the user when a normal object's type
14+
The metaobject has a practical benefit to the user when a normal object's type
1515
is needed. For example:
1616
1717
=begin code
@@ -23,9 +23,9 @@ sub show-type($arr) {
2323
show-type $arr; # OUTPUT: «Array␤»
2424
=end code
2525
26-
To get a more in-depth understanding of the meta object for a C<class>, here is
26+
To get a more in-depth understanding of the metaobject for a C<class>, here is
2727
an example repeated twice: once as normal declarations in Perl 6, and once
28-
expressed through the L<meta model|/type/Metamodel::ClassHOW>:
28+
expressed through the L<metamodel|/type/Metamodel::ClassHOW>:
2929
3030
class A {
3131
method x() { say 42 }
@@ -44,18 +44,18 @@ corresponds to:
4444
(except that the declarative form is executed at compile time, and the latter
4545
form does not).
4646
47-
The meta object behind an object can be obtained with C<$obj.HOW>, where HOW
47+
The metaobject behind an object can be obtained with C<$obj.HOW>, where HOW
4848
stands for Higher Order Workings (or, I<HOW the *%@$ does this work?>).
4949
50-
Here, the calls with C<.^> are calls to the meta object, so C<A.^compose> is
50+
Here, the calls with C<.^> are calls to the metaobject, so C<A.^compose> is
5151
a shortcut for C<A.HOW.compose(A)>. The invocant is passed in the parameter
5252
list as well, to make it possible to support prototype-style type systems,
53-
where there is just one meta object (and not one meta object per type, as
53+
where there is just one metaobject (and not one metaobject per type, as
5454
standard Perl 6 does it).
5555
5656
As the example above demonstrates, all object oriented features are
5757
available to the user, not just to the compiler. In fact the compiler just
58-
uses such calls to meta objects.
58+
uses such calls to metaobjects.
5959
6060
=head1 Metamethods
6161
@@ -98,7 +98,7 @@ Returns the metaclass object, as in "Higher Order Workings".
9898
C<HOW> returns an object of type C<Perl6::Metamodel::ClassHOW> in this case;
9999
objects of this type are used to build classes. The same operation on the C<&>
100100
sigil will return C<Perl6::Metamodel::ParametricRoleGroupHOW>. You will be
101-
calling this object whenever you use the C<^> syntax to access meta methods. In
101+
calling this object whenever you use the C<^> syntax to access metamethods. In
102102
fact, the code above is equivalent to C<say (&).HOW.HOW.name(&)> which is much
103103
more unwieldy. L<Metamodel::ClassHOW|/type/Metamodel::ClassHOW> is part of the Rakudo implementation, so use with caution.
104104
@@ -125,29 +125,28 @@ The presence of a C<Scalar> object indicates that the object is "itemized".
125125
say (1, 2, 3).VAR ~~ Scalar; # OUTPUT: «False␤»
126126
say $(1, 2, 3).VAR ~~ Scalar; # OUTPUT: «True␤»
127127
128-
=head1 Structure of the meta object system
128+
=head1 Structure of the metaobject system
129129
130-
B<Note:> this documentation largely reflects the meta object system as
130+
B<Note:> this documentation largely reflects the metaobject system as
131131
implemented by the L<Rakudo Perl 6 compiler|https://rakudo.org/>, since the
132132
L<design documents|https://design.perl6.org/> are very light on details.
133133
134134
For each type declarator keyword, such as C<class>, C<role>, C<enum>,
135-
C<module>, C<package>, C<grammar> or C<subset>, there is a separate meta
136-
class in the C<Metamodel::> namespace. (Rakudo implements them in the
135+
C<module>, C<package>, C<grammar> or C<subset>, there is a separate metaclass in the C<Metamodel::> namespace. (Rakudo implements them in the
137136
C<Perl6::Metamodel::> namespace, and then maps C<Perl6::Metamodel> to
138137
C<Metamodel>).
139138
140-
Many of the these meta classes share common functionality. For example
139+
Many of the these metaclasses share common functionality. For example
141140
roles, grammars and classes can all contain methods and attributes, as well
142141
as being able to do roles. This shared functionality is implemented in
143-
roles which are composed into the appropriate meta classes. For example
142+
roles which are composed into the appropriate metaclasses. For example
144143
L<role Metamodel::RoleContainer|/type/Metamodel::RoleContainer> implements
145144
the functionality that a type can hold roles and
146-
L<Metamodel::ClassHOW|/type/Metamodel::ClassHOW>, which is the meta class
145+
L<Metamodel::ClassHOW|/type/Metamodel::ClassHOW>, which is the metaclass
147146
behind the C<class> keyword, does this role.
148147
149-
Most meta classes have a C<compose> method that you must call when you're done
150-
creating or modifying a meta object. It creates method caches, validates things
148+
Most metaclasses have a C<compose> method that you must call when you're done
149+
creating or modifying a metaobject. It creates method caches, validates things
151150
and so on, and weird behavior ensues if you forget to call it, so don't :-).
152151
153152
=head2 Bootstrapping concerns
@@ -181,37 +180,37 @@ immutable. This is called I<composition>, and for syntactically declared
181180
types, it happens when the type declaration is fully parsed (so usually when
182181
the closing curly brace is parsed).
183182
184-
If you create types through the meta-object system directly, you must call
183+
If you create types through the metaobject system directly, you must call
185184
C<.^compose> on them before they become fully functional.
186185
187-
Most meta classes also use composition time to calculate some properties like
186+
Most metaclasses also use composition time to calculate some properties like
188187
the method resolution order, publish a method cache, and other house-keeping
189188
tasks. Meddling with types after they have been composed is sometimes
190189
possible, but usually a recipe for disaster. Don't do it.
191190
192191
=head2 Power and responsibility
193192
194-
The meta object protocol offers much power that regular Perl 6 code
193+
The metaobject protocol offers much power that regular Perl 6 code
195194
intentionally limits, such as calling private methods on classes that don't
196195
trust you, peeking into private attributes, and other things that usually
197196
simply aren't done.
198197
199-
Regular Perl 6 code has many safety checks in place; not so the meta model. It
198+
Regular Perl 6 code has many safety checks in place; not so the metamodel. It
200199
is close to the underlying virtual machine, and violating the contracts with
201200
the VM can lead to all sorts of strange behaviors that, in normal code, would
202201
obviously be bugs.
203202
204-
So be extra careful and thoughtful when writing meta types.
203+
So be extra careful and thoughtful when writing metatypes.
205204
206205
=head2 Power, convenience and pitfalls
207206
208-
The meta object protocol is designed to be powerful enough to implement the
207+
The metaobject protocol is designed to be powerful enough to implement the
209208
Perl 6 object system. This power occasionally comes at the cost of convenience.
210209
211210
For example, when you write C<my $x = 42> and then proceed to call methods on
212211
C<$x>, most of these methods end up acting on the L<integer|/type/Int> 42, not
213212
on the L<scalar container|/type/Scalar> in which it is stored. This is a piece
214-
of convenience found in ordinary Perl 6. Many parts of the meta object
213+
of convenience found in ordinary Perl 6. Many parts of the metaobject
215214
protocol cannot afford to offer the convenience of automatically ignoring
216215
scalar containers, because they are used to implement those scalar containers
217216
as well. So if you write C<my $t = MyType; ... ; $t.^compose> you are

0 commit comments

Comments
 (0)