develooper Front page | perl.beginners | Postings from December 2002

Re: Term Overloading

Thread Previous
From:
Rob Dixon
Date:
December 27, 2002 13:49
Subject:
Re: Term Overloading
Message ID:
20021227214948.56498.qmail@onion.perl.org
Hi Paul

Operator overloading is using the same operator to serve for multiple data
types. For instance a language that differentiated between string and
numeric data may overload the '+' operator to perform string concatenation.
It is frequently used in object-oriented programming to define the action of
the usual operators on a new class. A module supporting, say, complex
numbers could overload the arithmetic operators to work on a (real,
imaginary) complex pair so that the subsequent programming is more
intuitive.

HTH,

Rob


"Paul Kraus" <pkraus@pelsupply.com> wrote in message
news:014801c2addd$ce92cca0$64fea8c0@pkrausxp...
> Programming Perl makes many references to overloading something. For
> instance overloading the angle brackets. What does this term mean. I am
> assuming it just mean changing the default behavior but I wanted to make
> sure.
>
> Paul Kraus
> Network Administrator
> PEL Supply Company
> 216.267.5775 Voice
> 216-267-6176 Fax
> www.pelsupply.com
>



Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About