[Lazarus] "global" operator overloading
Michael Schnell
mschnell at lumino.de
Tue Feb 26 10:16:04 CET 2013
On 02/26/2013 09:07 AM, Sven Barth wrote:
>
> Helpers have the same problem. For now there is only one solution (as
> I already wrote): require that the type with which you specialize is a
> record. Then a class operator in that record can be defined.
>
> For the future I already have the following longterm plans:
> - add class operator support to class and object
> - allow to specify additional units after "specialize" that will be
> used when specializing (they will be added first, so that the original
> code is not unnecessarily modified)
>
>
Here a "funny" question come up:
Why do we (still) have records at all ?
We do have classes that allow for static and/or virtual methods (of
course no methods at all are possible, too. )
So why are record that now can have more than none methods. The only
difference I see is that records can reside in other places than on the
heap. But (if necessary) a certain type of class seems more straight
forward to me (of course with "record" as a synonym for compatibility) .
AFAIK even old style Turbo-Pascal "Objects" are still in place.... That
could be a certain type of class as well.
-Michael
More information about the Lazarus
mailing list