Re: Delphi 7/8 Language enhancements

From: Rudy Velthuis (TeamB) (rvelthuis_at_gmx.de)
Date: 12/03/03


Date: 3 Dec 2003 10:49:55 -0700

Craig Stuntz [TeamB] wrote:

> That would merely be a matter of the CLS.

The CLI, I think.

> But at least parts of operator overloading are not in the CLS at all --
> notably, the names of the implementing methods. So I don't think
that's
> the whole story, at the very least.

They are part of the ECMA docs about the CLI (Common Language Interface).

Partition I Architecture.pdf:
 
  10.3 Operator Overloading
    10.3.1 Unary operators
    10.3.2 Binary operators
    10.3.3 Conversion operators

Pages 62ff of that document contain all the names. But it also says, on
page 62:

"CLS (framework): Shall not publicly expose overloading except as
specified here. Frameworks authors
should bear in mind that many programming languages, including
Object-Oriented languages, do not support
overloading and will expose overloaded methods or properties through
mangled names. Most languages
support neither operator overloading nor overloading based on return
type, so op_Implicit and op_Explicit
shall always be augmented with some alternative way to gain the same
functionality. "

I think that could be a more valid reason for the CLS not using them.

But I think I have seen some instances of operator overloading in the CLS
on *classes*. Just do a Member Search (F4) on "op_" in Lutz Roeder's
Reflector, and you'll find them on numeric classes, on String, Cursor,
Version, XmlQualifiedName etc.

-- 
Rudy Velthuis (TeamB)
"This isn't right, this isn't even wrong."
 -- Wolfgang Pauli (1900-1958), upon reading a young physicist's paper


Relevant Pages

  • Re: Wishlist for Delphi 10 / 2006
    ... However, the potential for abuse, and I ... Any abstraction has the power to confuse when used badly. ... overloading became a significant 'style' because it is usually only ... > use operator overloading? ...
    (borland.public.delphi.non-technical)
  • Re: Confessions of an "OO Foreigner"
    ... In other areas and other languages it HAS fulfilled ... Cobol already had solutions to ... > expression operators to be methods, also with overloading. ...
    (comp.lang.cobol)
  • Re: Wishlist for Delphi 10 / 2006
    ... Operator overloading is incredibly useful in the right context, ... > they were being clever used operator overloading in a non-standard ... Have you ever worked with code where these features were used to ... not sure what Delphi 2005 offers for the Win32 developer here. ...
    (borland.public.delphi.non-technical)
  • Re: Java or C++?
    ... > Operator overloading works well when one is attempting to extend the ... a routine to get all specified items out of one container and into another. ...
    (comp.programming)
  • Re: Why cant overloads take into account the return type.
    ... >> think it hasn't made it into any languages? ... I think there's a good reason for overloading by return ... type not making it - it adds too much complexity for too little ... It's a fundamentally more complicated language though, ...
    (microsoft.public.dotnet.languages.csharp)

Loading