From 406f8c258486bcc700f9b7254f1e1bee5734083f Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Wed, 18 Jan 2012 13:32:32 -0800 Subject: [PATCH] overload.pm: spaces after dots; wording tweak --- lib/overload.pm | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/lib/overload.pm b/lib/overload.pm index eb39c94..749f731 100644 --- a/lib/overload.pm +++ b/lib/overload.pm @@ -272,7 +272,7 @@ The second argument is the other operand, or C in the case of a unary operator. The third argument is set to TRUE if (and only if) the two -operands have been swapped. Perl may do this to ensure that the +operands have been swapped. Perl may do this to ensure that the first argument (C<$self>) is an object implementing the overloaded operation, in line with general object calling conventions. For example, if C<$x> and C<$y> are Cs: @@ -288,7 +288,7 @@ have not been specified in the C directive, according to the rules for L described later. For example, the C above declared no subroutine for any of the operators C<-->, C (the overload key for -unary minus), or C<-=>. Thus +unary minus), or C<-=>. Thus operation | generates a call to ============|====================== @@ -487,7 +487,7 @@ If the corresponding operation for this value is overloaded too, the operation will be called again with this value. As a special case if the overload returns the object itself then it will -be used directly. An overloaded conversion returning the object is +be used directly. An overloaded conversion returning the object is probably a bug, because you're likely to get something that looks like C. @@ -521,7 +521,7 @@ second argument (that is, in the slot that for binary operators is used to pass the second operand). Calling an overloaded filetest operator does not affect the stat value -associated with the special filehandle C<_>. It still refers to the +associated with the special filehandle C<_>. It still refers to the result of the last C, C or unoverloaded filetest. This overload was introduced in Perl 5.12. @@ -678,7 +678,7 @@ Since some operations can be automatically generated from others, there is a minimal set of operations that need to be overloaded in order to have the complete set of overloaded operations at one's disposal. Of course, the autogenerated operations may not do exactly what the user -expects. The minimal set is: +expects. The minimal set is: + - * / % ** << >> x <=> cmp @@ -778,7 +778,7 @@ Note: The subroutine for C<'='> does not overload the Perl assignment operator: it is used only to allow mutators to work as described -here. (See L above.) +here. (See L above.) =item * @@ -971,7 +971,8 @@ Package C provides the following public functions: =item overload::StrVal(arg) -Gives string value of C as in absence of stringify overloading. If you +Gives the string value of C as in the +absence of stringify overloading. If you are using this to get the address of a reference (useful for checking if two references point to the same thing) then you may be better off using C, which is faster. @@ -1056,8 +1057,8 @@ What follows is subject to change RSN. The table of methods for all operations is cached in magic for the symbol table hash for the package. The cache is invalidated during processing of C, C, new function -definitions, and changes in @ISA. However, this invalidation remains -unprocessed until the next Cing into the package. Hence if you +definitions, and changes in @ISA. However, this invalidation remains +unprocessed until the next Cing into the package. Hence if you want to change overloading structure dynamically, you'll need an additional (fake) Cing to update the table. @@ -1065,7 +1066,7 @@ additional (fake) Cing to update the table. queue. This is how a single variable may participate in multiple forms of magic simultaneously. For instance, environment variables regularly have two forms at once: their %ENV magic and their taint -magic. However, the magic which implements overloading is applied to +magic. However, the magic which implements overloading is applied to the stashes, which are rarely used directly, thus should not slow down Perl.) @@ -1082,10 +1083,10 @@ in doubt, test your speed with C and without it. So far there have been no reports of substantial speed degradation if Perl is compiled with optimization turned on. -There is no size penalty for data if overload is not used. The only +There is no size penalty for data if overload is not used. The only size penalty if overload is used in some package is that I the packages acquire a magic during the next Cing into the -package. This magic is three-words-long for packages without +package. This magic is three-words-long for packages without overloading, and carries the cache table if the package is overloaded. It is expected that arguments to methods that are not explicitly supposed @@ -1579,8 +1580,8 @@ induces diagnostic messages. Using the C command of Perl debugger (see L) one can deduce which operations are overloaded (and which ancestor triggers -this overloading). Say, if C is overloaded, then the method C<(eq> -is shown by debugger. The method C<()> corresponds to the C +this overloading). Say, if C is overloaded, then the method C<(eq> +is shown by debugger. The method C<()> corresponds to the C key (in fact a presence of this method shows that this package has overloading enabled, and it is what is used by the C function of module C). @@ -1601,7 +1602,7 @@ The arguments should come in pairs. =item '%s' is not a code reference (W) The second (fourth, sixth, ...) argument of overload::constant needs -to be a code reference. Either an anonymous subroutine, or a reference +to be a code reference. Either an anonymous subroutine, or a reference to a subroutine. =item overload arg '%s' is invalid @@ -1690,7 +1691,7 @@ The symbol table is filled with names looking like line-noise. =item * For the purpose of inheritance every overloaded package behaves as if -C is present (possibly undefined). This may create +C is present (possibly undefined). This may create interesting effects if some package is not overloaded, but inherits from two overloaded packages. -- 2.7.4