Skip to content

Commit e7942a0

Browse files
committed
More meta( |-) eliminated refs #3024
1 parent 9407baa commit e7942a0

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

doc/Language/objects.pod6

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ provide that method, the method of that name in one of the parent classes is
552552
invoked instead, if it exists. The order in which parent classes are
553553
consulted is called the I<method resolution order> (MRO). Perl 6 uses the
554554
L<C3 method resolution order|https://en.wikipedia.org/wiki/C3_linearization>.
555-
You can ask a type for its MRO through a call to its meta class:
555+
You can ask a type for its MRO through a call to its metaclass:
556556
557557
=for code
558558
say List.^mro; # ((List) (Cool) (Any) (Mu))
@@ -933,7 +933,7 @@ then C<X::Ouch> will inherit directly from Exception, as we can see above
933933
by listing its parents.
934934
935935
As they do not use what can properly be called inheritance, roles are not part
936-
of the class hierarchy. Roles are listed with the C<.^roles> meta-method
936+
of the class hierarchy. Roles are listed with the C<.^roles> metamethod
937937
instead, which uses C<transitive> as flag for including all levels or just the
938938
first one. Despite this, a class or instance may still be tested with
939939
smartmatches or type constraints to see if it does a role.
@@ -1003,7 +1003,7 @@ say Point.dimensions; # OUTPUT «2␤»
10031003
We call this automatic creation of classes I<punning>, and the generated class
10041004
a I<pun>.
10051005
1006-
Punning is not caused by most L<meta-programming|/language/mop> constructs,
1006+
Punning is not caused by most L<metaprogramming|/language/mop> constructs,
10071007
however, as those are sometimes used to work directly with roles.
10081008
10091009
X<|Parameterized Roles>
@@ -1137,35 +1137,33 @@ say %seen<not-there>.defined; # OUTPUT: «True␤» (0 may be False but is well
11371137
say Int.new(%seen<not-there>); # OUTPUT: «0␤»
11381138
=end code
11391139
1140-
=head1 Meta-object programming and introspection
1140+
=head1 Metaobject programming and introspection
11411141
1142-
Perl 6 has a meta object system, which means that the behavior of objects,
1142+
Perl 6 has a metaobject system, which means that the behavior of objects,
11431143
classes, roles, grammars, enums, etc. are themselves controlled by other
1144-
objects; those objects are called I<meta objects>. Meta objects are, like
1145-
ordinary objects, instances of classes, in this case we call them I<meta
1146-
classes>.
1144+
objects; those objects are called I<metaobjects>. Metaobjects are, like
1145+
ordinary objects, instances of classes, in this case we call them I<metaclasses>.
11471146
1148-
For each object or class you can get the meta object by calling C<.HOW> on it.
1147+
For each object or class you can get the metaobject by calling C<.HOW> on it.
11491148
Note that although this looks like a method call, it works more like a macro.
11501149
1151-
So, what can you do with the meta object? For one you can check if two
1152-
objects have the same meta class by comparing them for equality:
1150+
So, what can you do with the metaobject? For one you can check if two
1151+
objects have the same metaclass by comparing them for equality:
11531152
11541153
=begin code
11551154
say 1.HOW === 2.HOW; # OUTPUT: «True␤»
11561155
say 1.HOW === Int.HOW; # OUTPUT: «True␤»
11571156
say 1.HOW === Num.HOW; # OUTPUT: «False␤»
11581157
=end code
11591158
1160-
Perl 6 uses the word I<HOW> (Higher Order Workings) to refer to the meta
1161-
object system. Thus it should be no surprise that in Rakudo, the class name
1162-
of the meta class that controls class behavior is called
1163-
C<Perl6::Metamodel::ClassHOW>. For each class there is one instance of
1164-
C<Perl6::Metamodel::ClassHOW>.
1159+
Perl 6 uses the word I<HOW> (Higher Order Workings) to refer to the metaobject
1160+
system. Thus it should be no surprise that in Rakudo, the class name of the
1161+
metaclass that controls class behavior is called C<Perl6::Metamodel::ClassHOW>.
1162+
For each class there is one instance of C<Perl6::Metamodel::ClassHOW>.
11651163
1166-
But of course the meta model does much more for you. For example, it allows
1164+
But of course the metamodel does much more for you. For example, it allows
11671165
you to introspect objects and classes. The calling convention for methods on
1168-
meta objects is to call the method on the meta object and pass in the object
1166+
metaobjects is to call the method on the metaobject and pass in the object
11691167
of interest as first argument to the object. So to get the name of the class
11701168
of an object, you could write:
11711169
@@ -1179,7 +1177,7 @@ say 1.HOW.name(1); # OUTPUT: «Int␤»
11791177
=end code
11801178
11811179
(The motivation is that Perl 6 also wants to allow a more prototype-based
1182-
object system, where it's not necessary to create a new meta object for
1180+
object system, where it's not necessary to create a new metaobject for
11831181
every type).
11841182
11851183
There's a shortcut to keep from using the same object twice:
@@ -1190,9 +1188,9 @@ say 1.^name; # OUTPUT: «Int␤»
11901188
say 1.HOW.name(1); # OUTPUT: «Int␤»
11911189
=end code
11921190
1193-
See L<Metamodel::ClassHOW|/type/Metamodel::ClassHOW> for documentation on
1194-
the meta class of C<class> and also the L<general documentation on the meta
1195-
object protocol|/language/mop>.
1191+
See L<Metamodel::ClassHOW|/type/Metamodel::ClassHOW> for documentation on the
1192+
metaclass of C<class> and also the L<general documentation on the metaobject
1193+
protocol|/language/mop>.
11961194
11971195
=end pod
11981196

0 commit comments

Comments
 (0)