Author: lwall
Date: 2008-12-18 22:20:36 +0100 (Thu, 18 Dec 2008)
New Revision: 24474

Modified:
   docs/Perl6/Spec/S12-objects.pod
   docs/Perl6/Spec/S29-functions.pod
Log:
[Spec] redefine WHAT to stringify to typename plus '()'


Modified: docs/Perl6/Spec/S12-objects.pod
===================================================================
--- docs/Perl6/Spec/S12-objects.pod     2008-12-18 20:44:04 UTC (rev 24473)
+++ docs/Perl6/Spec/S12-objects.pod     2008-12-18 21:20:36 UTC (rev 24474)
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall <la...@wall.org>
   Date: 27 Oct 2004
-  Last Modified: 7 Nov 2008
+  Last Modified: 18 Dec 2008
   Number: 12
-  Version: 65
+  Version: 66
 
 =head1 Overview
 
@@ -1865,7 +1865,7 @@
 
 Metamethods for objects are named with interrogative pronouns in uppercase:
 
-    WHAT        the prototype object of the type, stringifies to short name
+    WHAT        the protoobject of the type, stringifies to short name ~ '()'
     WHICH       the object's identity value
     WHO         the package supporting the object, stringifies to long name
     WHERE       the memory address of the object
@@ -1898,12 +1898,15 @@
 as the first argument to methods of the metaclass, while the other
 forms require you to pass this explicitly.
 
+Note that WHAT appends C<()> to indicate emptiness.  Use C<.perl> to get the
+bare name from a protoobject.
+
 In general, use of these in ordinary code should be a red flag that
 Something Very Strange is going on.  (Hence the allcaps.)  Most code
 should use Perl 6's operators that make use of this information
 implicitly.  For instance, instead of
 
-    $obj.WHAT eq 'Dog'
+    $obj.WHAT eq 'Dog()'
     $x.WHICH === $y.WHICH
     $obj.WHAT.bless(%args)
 

Modified: docs/Perl6/Spec/S29-functions.pod
===================================================================
--- docs/Perl6/Spec/S29-functions.pod   2008-12-18 20:44:04 UTC (rev 24473)
+++ docs/Perl6/Spec/S29-functions.pod   2008-12-18 21:20:36 UTC (rev 24474)
@@ -14,8 +14,8 @@
                 Carl Mäsak <cma...@gmail.com>
                 Moritz Lenz <mor...@faui2k3.org>
  Date:          12 Mar 2005
- Last Modified: 14 Dec 2008
- Version:       32
+ Last Modified: 18 Dec 2008
+ Version:       33
 
 This document attempts to document the list of builtin functions in Perl 6.
 It assumes familiarity with Perl 5 and prior synopses.
@@ -2009,7 +2009,7 @@
 
 There is no ref() any more, since it was almost always used to get
 the type name in Perl 5.  If you really want the type name, you can
-use C<$var.WHAT>.  If you really want P5 ref
+use C<$var.WHAT.perl>.  If you really want P5 ref
 semantics, use C<Perl5::p5ref>.
 
 But if you're just wanting to test against a type, you're likely better off

Reply via email to