Skip to content

Commit

Permalink
[S03, S12] ^Dog no longer means Dog.HOW
Browse files Browse the repository at this point in the history
Use the Dog.^foo form when you want to call methods on Dog's metaclass.

This makes prefix:<^> unambiguously mean 0 ..^ $something, with no
weird exception for type objects.
  • Loading branch information
Carl Masak committed Jan 14, 2012
1 parent be88f7f commit bf4c011
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
8 changes: 2 additions & 6 deletions S03-operators.pod
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Synopsis 3: Perl 6 Operators

Created: 8 Mar 2004

Last Modified: 1 Jan 2012
Version: 234
Last Modified: 14 Jan 2012
Version: 235

=head1 Overview

Expand Down Expand Up @@ -3533,10 +3533,6 @@ The unary C<^> operator generates a range from C<0> up to

for ^4 { say $_ } # 0, 1, 2, 3

If applied to a type name, it indicates the metaclass instance instead,
so C<^Moose> is short for C<HOW(Moose)> or C<Moose.HOW>. It still kinda
means "what is this thing's domain" in an abstract sort of way.

=head2 Auto-priming of ranges

[This section is conjectural, and may be ignored for 6.0.]
Expand Down
9 changes: 2 additions & 7 deletions S12-objects.pod
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Synopsis 12: Objects

Created: 27 Oct 2004

Last Modified: 19 Sep 2011
Version: 123
Last Modified: 14 Jan 2012
Version: 124

=head1 Overview

Expand Down Expand Up @@ -185,10 +185,6 @@ may tell you that they are defined, while others may tell you that
they are undefined. That's up to the object, and depends on how the
metaclass chooses to dispatch the C<.defined> method.

The notation C<^Dog> is syntactic sugar for C<Dog.HOW()>, so C<^> can be
considered the "class" sigil when you want to talk about the current
metaclass instance.

=head2 Closed classes

Classes are open and non-final by default, but may easily be closed
Expand Down Expand Up @@ -2313,7 +2309,6 @@ of the class:
The C<^> metasyntax is equivalent to C<.HOW>:

MyClass.HOW.methods($obj) # get the method list of MyClass
^MyClass.methods($obj) # get the method list of MyClass
MyClass.^methods() # get the method list of MyClass

Each object of the class also has a C<.HOW> or C<.^> method:
Expand Down

0 comments on commit bf4c011

Please sign in to comment.