Author: larry Date: Wed Sep 13 17:36:38 2006 New Revision: 11979 Modified: doc/trunk/design/syn/S02.pod doc/trunk/design/syn/S12.pod
Log: regularized metaobject method names as requested by dduncan++ Modified: doc/trunk/design/syn/S02.pod ============================================================================== --- doc/trunk/design/syn/S02.pod (original) +++ doc/trunk/design/syn/S02.pod Wed Sep 13 17:36:38 2006 @@ -14,7 +14,7 @@ Date: 10 Aug 2004 Last Modified: 13 Sept 2006 Number: 2 - Version: 67 + Version: 68 This document summarizes Apocalypse 2, which covers small-scale lexical items and typological issues. (These Synopses also contain @@ -485,12 +485,12 @@ metaclass instance managing it, regardless of whether the object is defined: - 'x'.HOW.get_method_list; # get available methods for strings - Str.HOW.get_method_list; # same thing with the prototype object Str - HOW(Str).get_method_list; # same thing as function call + 'x'.HOW.methods; # get available methods for strings + Str.HOW.methods; # same thing with the prototype object Str + HOW(Str).methods; # same thing as function call - 'x'.get_method_list; # this is an error - not a meta object - Str.get_method_list; # same thing + 'x'.methods; # this is likely an error - not a meta object + Str.methods; # same thing (For a prototype system (a non-class-based object system), all objects are merely managed by the same meta object.) Modified: doc/trunk/design/syn/S12.pod ============================================================================== --- doc/trunk/design/syn/S12.pod (original) +++ doc/trunk/design/syn/S12.pod Wed Sep 13 17:36:38 2006 @@ -14,7 +14,7 @@ Date: 27 Oct 2004 Last Modified: 13 Sept 2006 Number: 12 - Version: 23 + Version: 24 =head1 Overview @@ -1532,19 +1532,19 @@ for the class (or other metaobject protocol) implementing the objects of the class: - MyClass.getmethods() # call MyClass's .getmethods method (error?) - MyClass.HOW.getmethods() # get the method list of MyClass + MyClass.methods() # call MyClass's .methods method (error?) + MyClass.HOW.methods() # get the method list of MyClass -The C<^> metasyntax is equivalent to .HOW: +The C<^> metasyntax is equivalent to C<.HOW>: - MyClass.HOW.getmethods() # get the method list of MyClass - ^MyClass.getmethods() # get the method list of MyClass - MyClass.^getmethods() # get the method list of MyClass + MyClass.HOW.methods() # get the method list of MyClass + ^MyClass.methods() # 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: - $obj.HOW.getmethods(); - $obj.^getmethods(); + $obj.HOW.methods(); + $obj.^methods(); Class traits may include: @@ -1572,7 +1572,7 @@ prototype objects, in which case stringification is not likely to produce something of interest to non-gurus.) -The C<.HOW.getmethods> method returns method-descriptors containing: +The C<.HOW.methods> method returns method-descriptors containing: name the name of the method signature the parameters of the method @@ -1580,11 +1580,11 @@ multi whether duplicate names are allowed do the method body -The C<.getmethods> method has a selector parameter that lets you +The C<.methods> method has a selector parameter that lets you specify whether you want to see a flattened or hierarchical view, whether you're interested in private methods, and so forth. -The C<.getattributes> method returns a list of attribute descriptors +The C<.attributes> method returns a list of attribute descriptors that have traits like these: name @@ -1603,7 +1603,23 @@ $obj.HOW.does(Dog) $obj.HOW.isa(Mammal) -But C<Object> gives you shortcuts to those, if you don't override them. +or + + $obj.^can("bark") + $obj.^does(Dog) + $obj.^isa(Mammal) + +But C<Any> gives you shortcuts to those: + + $obj.can("bark") + $obj.does(Dog) + $obj.isa(Mammal) + +These, may, of course, be overridden in a subclass, so don't use the +short form unless you wish to allow for overrides. In general, C<Any> +will delegate only those metamethods that read well when reasoning +about an individual object. Infrastructural methods like C<.methods> +and C<.attributes> are not delegated, so C<$obj.methods> fails. The smartmatch: