From: Steffen Müller <0mgwtfbbq@sneakemail.com> Date: Sun, 5 Feb 2006 12:26:00 +0000 (+0000) Subject: Documentation patch for overload X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=84fc275b0c62bafad833d20cf8222d1372e9fd12;p=p5sagit%2Fp5-mst-13.2.git Documentation patch for overload Message-ID: <43E5E0E9.1070707@sneakemail.com> p4raw-id: //depot/perl@27096 --- diff --git a/lib/overload.pm b/lib/overload.pm index e11c30f..943d836 100644 --- a/lib/overload.pm +++ b/lib/overload.pm @@ -668,6 +668,24 @@ value is a scalar and not a reference. =back +=head1 Minimal set of overloaded operations + +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. This minimal +set is: + + + - * / % ** << >> x + <=> cmp + & | ^ ~ + atan2 cos sin exp log sqrt int + +Additionally, you need to define at least one of string, boolean or +numeric conversions. The string conversion can also be used to +emulate concatenation, so we'll assume string conversion is defined. +It usually makes sense to explicitly overload all conversion +operations. + =head1 Losing overloading The restriction for the comparison operation is that even if, for example,